Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Actor cogs.......
Actor cogs.......
2002-07-07, 1:51 PM #1
Here is ACTOR_MN.cog

Quote:
<font face="Verdana, Arial" size="2"># Jedi Knight Cog Script
#
# ACTOR_MN.COG
#
#
# Actor COG for Narshadda Male Pedestrians
# Triggers various voice lines when touched
# Possibly creates powerup upon death
# Increases morality bin by one upon death by player
# Increases pedestrian counter by one upon creation
#
# [CR]
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
#
# ========================================================================================

symbols

message created
message killed
message skill
message touched
message timer
message damaged

template powerup1=+DHealthPack local
template powerup2=+DShield local
template powerup3=+DBattery local
flex rval local
int bin local
int count local
int id local
thing newThing local
thing me local
thing player local
thing toucher local
thing killer local
sound hey=i00mn02z.wav
sound leaves=i00mn10z.wav
sound nothing=i00mn12z.wav
sound mind=i00mn13z.wav
sound whats=i00mn16z.wav
int damage local
int sound local

end

# ========================================================================================

code

damaged:
StopSound(sound, 0);
damage = GetParam(0);
if(GetParam(1) == 16)
{
damage = (damage * 2.0);
}
ReturnEx(damage);
return;

# ....................................................................................

touched:
me = GetSenderRef();
toucher = GetSourceRef();
player = GetLocalPlayerThing();

if (player != toucher) return;

if (BitTest(AiGetMode(me), 0x800)) return;

if (count == 1) return;

rval = Rand();

if (GetThingUserData(me) == 2)
{
sound = PlaySoundThing(nothing, me, 1, -1, -1, 0x10080);
SetThingUserData(me, GetThingUserData(me) + 1);
count = 1;
SetTimerEx(3.0, 0, 0.0, 0.0);
return;
}

if (GetThingUserData(me) == 3)
{
sound = PlaySoundThing(mind, me, 1, -1, -1, 0x10080);
count = 1;
SetThingUserData(me, GetThingUserData(me) + 1);
SetTimerEx(3.0, 0, 0.0, 0.0);
return;
}

if (GetThingUserData(me) >= 4)
{
sound = PlaySoundThing(leaves, me, 1, -1, -1, 0x10080);
count = 1;
SetTimerEx(3.0, 0, 0.0, 0.0);
return;
}

if (rval < 0.47)
{
sound = PlaySoundThing(hey, me, 1, -1, -1, 0x10080);
SetThingUserData(me, GetThingUserData(me) + 1);
SetTimerEx(3.0, 0, 0.0, 0.0);
}
else if (rval < 0.95)
{
sound = PlaySoundThing(whats, me, 1, -1, -1, 0x10080);
SetThingUserData(me, GetThingUserData(me) + 1);
SetTimerEx(3.0, 0, 0.0, 0.0);
}

count = 1;

return;

# ....................................................................................

created:
SetThingUserData(GetSenderRef(), 0);
SetTimerEx(1.0, 1, 0.0, 0.0);
return;

# ....................................................................................

killed:
player = GetLocalPlayerThing();
killer = GetSourceRef();

// Player killed a pedestrian.
if (player == killer)
{
ChangeInv( player, 72, 1.0 );
}

rval = Rand();
if (rval < 0.05)
{
newThing = CreateThing(powerup1, GetSenderRef());
SetLifeleft(newThing, 200.0);
}
else if (rval <0.10)
{
newThing = CreateThing(powerup2, GetSenderRef());
SetLifeLeft(newthing, 200.0);
}
else if (rval <0.15)
{
newThing = CreateThing(powerup3, GetSenderRef());
SetLifeLeft(newthing, 200.0);
}
return;

# ........................................................................................

skill:
bin = GetParam(0);
if (bin == 31) // Force Grip
{
ReturnEx(10); // return base damage that is taken by this actor.
return;
}
else
if (bin == 34) // Deadly Sight
{
ReturnEx(5); // return base damage that is taken by this actor.
return;
}

ReturnEx(-1);
return;


timer:
id = GetSenderId();
if (id == 0)
{
count = 0;
}
else
if (id == 1)
{
player = GetLocalPlayerThing();
ChangeInv( player, 73, 1.0 );
}
return;

end

</font>


What i want to do is edit it so the player cannot be killed, and nothing happens when he is shot at. What should i take out?
If i take out "Killed" and "Damaged" in Symbols, would that be enough?

Ive made some custom guys, i have made new AI files, templates, the works, and all i need is for it to be non-responsive to being shot/punched/hurt at all.


------------------
Sanctum de la Mort

[This message has been edited by Dash_rendar (edited July 07, 2002).]
2002-07-07, 4:14 PM #2
Damaged message. Get rid of the If statement, damage = GetParam(0); and change to ReturnEx(0); Leave everything else. The non-responsive thing, thats in the AI file. Go to jkspecs and read the AI files section. Flee argument.

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack

↑ Up to the top!