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 → Cog that will NOT work (RoX TC)
Cog that will NOT work (RoX TC)
2002-05-01, 3:34 PM #1
*@!(*@$&(*@#

*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


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

[This message has been edited by Lord_Grismath (edited May 01, 2002).]
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-05-01, 7:13 PM #2
Try replacing 'GetSenderRef' with 'GetSenderRef()' [http://forums.massassi.net/html/smile.gif]

Raynar
Pagewizard_YKS: "making your own lightsaber doesn't make you a nerd... "
Raynar - the man with a 10.75" ePenis
2002-05-02, 12:32 AM #3
Oh. Oops. /me feels stupid

Thanks, I'll give that a try.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-05-02, 4:52 AM #4
Also, player is undefined.

------------------
Author of the Jedi Knight DataMaster.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-05-04, 1:14 AM #5
oops :] might want to try that too, hehe. Thanks.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-05-05, 11:28 AM #6
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
"I hate ravers. Raving Fruit Boy wears stupidass jewelry so he'll be the coolest kid at the Nitrous Oxide tent." --Cliff Yablonski

↑ Up to the top!