PDA

View Full Version : Cog that will NOT work (RoX TC)



Lord_Grismath
05-01-2002, 06:34 PM
*@!(*@$&(*@#

*mumbles something about not being able to get cog to work*

Is there anything I missed while scanning over this some 5 times?

Basically, to add realism, when the player enters water in his armour early on, he begins to sink (SetGravity) and take sector damage, he can then change clothes, by SetThingModel. The entire cog just doesn't seem to work, no matter what.

Please help, thanks.


# Jedi Knight Cog Script
#
# MARINERCLOTHES.COG
#
# Description
#
# Homecooked COG for switching Tahben's armour for some lighter clothes, more
# appropriate for swimming. Adds a bit more realism, and now the Mariner will make
# fun of you for sinking in your armour, and you'll take sector damage.
#
# This Cog is Not supported by LucasArts Entertainment Co

symbols

message entered
message activated
message pulse

model regplayer
model otherclothes

model otracloth
model armour

thing clothes
thing mariner

sector water
sector shore

int wear=1 local
int comment=0 local
int slow=0 local
int num_players local

end

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

code

entered:

if(GetSenderRef == water) {
if(wear == 1) {
SetActorExtraSpeed(player, -1.5);
SetGravity(6);
slow = 1;
if(comment == 0) {
print("Mariner: Heh, ye brave knight sinks now like an iron weight!");
Sleep(2);
print("Come back to my shack and trade in thy iron for lighter cloth.");
comment = 1;
}
SetPulse(1.0);
} Else {
return;
}
}
if(GetSenderRef == shore) {
if(slow == 1) {
SetActorExtraSpeed(player, 0);
SetGravity(4);
slow = 0;
} Else {
return;
}
}

return;

activated:

if(GetSenderRef == clothes) {
player = GetLocalPlayerThing();
AddDynamicTint(player, 1, 1, 1);
if(wear == 0) {
SetThingModel(player, regplayer);
SetThingModel(clothes, armour);
wear = 1;
SetActorExtraSpeed(player, 0);
slow = 0;
}
if(wear == 1) {
SetThingModel(player, otherclothes);
SetThingModel(clothes, otracloth);
wear = 0;
SetActorExtraSpeed(player, 0.5);
slow = 2;
}
}
return;

pulse:

player = GetLocalPlayerThing();
num_players=GetSectorPlayerCount(water);
if(num_players >= 1) {
DamageThing(player, 3.0, 0x1, player);
}

return;


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

end


Eh, easier to read without the CODE tags, http://forums.massassi.net/html/tongue.gif

[This message has been edited by Lord_Grismath (edited May 01, 2002).]

Raynar
05-01-2002, 10:13 PM
Try replacing 'GetSenderRef' with 'GetSenderRef()' http://forums.massassi.net/html/smile.gif

Raynar

Lord_Grismath
05-02-2002, 03:32 AM
Oh. Oops. /me feels stupid

Thanks, I'll give that a try.

SaberMaster
05-02-2002, 07:52 AM
Also, player is undefined.

------------------
Author of the Jedi Knight DataMaster (http://www.geocities.com/sabersdomain/fileframe.html).
Visit Saber's Domain (http://www.geocities.com/sabersdomain).

Lord_Grismath
05-04-2002, 04:14 AM
oops :] might want to try that too, hehe. Thanks.

XxÇHŤ§xX
05-05-2002, 02:28 PM
Also, I don't know if you did this on purpose, but you might want to define the models.

Change it from your current method,
model modelname
to something like this:
model modelname=modelname.3do local