*@!(*@$&(*@#
*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,
[/EDIT]
[This message has been edited by Lord_Grismath (edited May 01, 2002).]
*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 [http://forums.massassi.net/html/tongue.gif]](http://forums.massassi.net/html/tongue.gif)
[This message has been edited by Lord_Grismath (edited May 01, 2002).]