View Full Version : Werewolf Morphing Cog
RaccoonKing
10-07-2000, 11:50 AM
I'm pretty much a level cogger so don't have much experience with mod cogging. Anway for the Discworld TC we are having a werewolf skin, and this is what i've done so far for the morphing cog.
# Werewolf.COG
#
# [By RaccoonKing]
#
symbols
template wolfmodel=wolf.3do local
template humanbuffer=angua.3do local
int wolfstatus=0 local
sector cursector local
thing player
message startup
message pulse
message timer
message killed
message activated
end
# ================================================== ======================================
code
startup:
player = GetLocalPlayerThing();
humanbuffer=GetThingTemplate(player);
Return;
# .................................................. ......................................
pulse:
player = GetLocalPlayerThing();
cursector=GetThingSector(player);
if GetSectorFlags(cursector) == 0x40000000
{
SetThingModel(player,wolfmodel);
ParseArg(player, "puppet=wolf.pup");
ParseArg(player, "snd=wolf.snd");
wolfstatus = 1;
}
Return;
# .................................................. ......................................
timer:
SetPulse(1.5);
Return;
# .................................................. ......................................
killed:
player = GetLocalPlayerThing();
SetThingModel(player,humanbuffer);
ParseArg(player, "puppet=wolfman.pup");
ParseArg(player, "snd=ky.snd");
wolfstatus = 0;
Return;
# .................................................. ......................................
activated:
player = GetLocalPlayerThing();
if wolfstatus == 0
{
SetThingModel(player,wolfmodel);
ParseArg(player, "puppet=wolf.pup");
ParseArg(player, "snd=wolf.snd");
wolfstatus = 1;
}
else if wolfstatus == 1
{
SetThingModel(player,humanbuffer);
ParseArg(player, "puppet=wolfman.pup");
ParseArg(player, "snd=ky.snd");
wolfstatus = 0;
}
Return;
end
Could i have some help in making sure this works properly, ie free up resources correctly, correct verbs etc. Thanks http://forums.massassi.net/html/smile.gif
[This message has been edited by RaccoonKing (edited October 07, 2000).]
GuNbOy
10-07-2000, 12:06 PM
you dont use tmeplates for 3dos
use this
model wolfmodel=wolf.3do
model humanbuffer=angus.3do
and i dont see why you used:
humanbuffer=GetThingTemplate(player);
RaccoonKing
10-07-2000, 01:03 PM
We may be having a few Generic werewolves as well as Angua, so thats why it reads the player model at startup
GuNbOy
10-07-2000, 02:19 PM
if you set the human buffer to GetThingTemplate or whatever, it wont be set to the 3do you set it to in the symbols though.
zagibu
10-07-2000, 02:39 PM
well...i think this will not work...somehow JK doesn't let you change puppets more than 3 times...dunno why, but i encountered this problem while working on my Kill JarJar mod...but i might be wrong, though...
RaccoonKing
10-08-2000, 07:21 AM
...but Spork changes the pup file everytime you toggle the lightstaff
RaccoonKing
10-08-2000, 08:04 AM
BTW does ParseArg(whatever) just temporarily change the template (static.jkl) values for the given thing?
RaccoonKing
10-08-2000, 08:08 AM
And now... the latest version of the cog... it does nothing at all. In jkstrings.uni i gave it the activate16 hotkey. In items.dat i gave it bin #116 with flag 0x100, min value 0, maxvalue 1. The cog is as follows
# Werewolf.COG
#
# [By RaccoonKing]
# Morphs the player into a wolf when command is activated or enters moonlight
symbols
model wolfmodel=mb.3do local
model humanbuffer=ky.3do local
int wolfstatus=0 local
sector cursector local
thing player
sound WolfActivate=21forceabsorb1.wav
sound WolfDeactivate=21forceabsorb1.wav
message startup
message pulse
message timer
message killed
message activated
end
# ================================================== ======================================
code
startup:
player = GetLocalPlayerThing();
humanbuffer = GetThingTemplate(player);
Return;
# .................................................. ......................................
pulse:
player = GetLocalPlayerThing();
cursector = GetThingSector(player);
if(GetInv(player, 116))
{
if GetSectorFlags(cursector) == 0x40000000 // Continues is sector is flagged as moonlight
{
SetThingModel(player,wolfmodel);
ParseArg(player, "puppet=mb.pup");
ParseArg(player, "snd=ky.snd");
wolfstatus = 1;
SetInvActivated(player, 116, 1);
PlaySoundThing(WolfActivate, player, 1.0, -1, -1, 0x80);
Print("The Lunar Rays have penetrated your morphogenic memory");
}
}
Return;
# .................................................. ......................................
timer:
SetPulse(1);
Return;
# .................................................. ......................................
killed:
player = GetLocalPlayerThing();
SetThingModel(player,humanbuffer);
ParseArg(player, "puppet=ky.pup");
ParseArg(player, "snd=ky.snd");
SetInvActivated(player, 116, 0);
PlaySoundThing(WolfDeactivate, player, 1.0, -1, -1, 0x80);
wolfstatus = 0;
Return;
# .................................................. ......................................
activated:
player = GetLocalPlayerThing();
if(GetInv(player, 116))
{
if wolfstatus == 0
{
SetThingModel(player,wolfmodel);
ParseArg(player, "puppet=mb.pup");
ParseArg(player, "snd=ky.snd");
wolfstatus = 1;
SetInvActivated(player, 116, 1);
PlaySoundThing(WolfActivate, player, 1.0, -1, -1, 0x80);
Print("You have morphed into a Werewolf");
}
else if wolfstatus == 1
{
SetThingModel(player,humanbuffer);
ParseArg(player, "puppet=ky.pup");
ParseArg(player, "snd=ky.snd");
SetInvActivated(player, 116, 0);
PlaySoundThing(WolfDeactivate, player, 1.0, -1, -1, 0x80);
wolfstatus = 0;
Print("You have morphed back into a human");
}
}
Return;
end
BTW i changed the wolf.3do to the mousebot (mb.3do) for the benefit of testing
[This message has been edited by RaccoonKing (edited October 08, 2000).]
Fernando_the_Hunn
10-08-2000, 10:33 AM
GetThingModel not GetThingTemplate... You never set a timer, so the the pulse never gets set... thats all I can see now...
------------------
cogs dont kill people. people kill people...
mailto:no_oneatall@hotmail.comno_oneatall@hotmail. com</A>
ICQ 81116825
===========================================
Evil Cog master of the Western TC!
zagibu
10-08-2000, 01:17 PM
well...are you sure that you don't need the brackets in the if conditions? And im not sure about your first if condition...GetInv returns a flex value...not sure if you can use flex values as boolean values (what you are doing here)
try if(GetInv(player, bin)!=0)...
RaccoonKing
10-09-2000, 11:01 AM
The cog works properly now (i tested it with Kell Dragon 3do, pup and snd) and i can change pup files as many times as i want. Zagibu since you are having trouble with pup files here is the full script for the cog (i plan on refining it later, but is fully functional for now)
# Werewolf.COG
#
# [By RaccoonKing]
# Morphs the player into a wolf when command is activated or enters moonlight
symbols
int wolfstatus=0 local
sector cursector local
thing player
sound WolfActivate=21forceabsorb1.wav
sound WolfDeactivate=21forceabsorb1.wav
message newplayer
message pulse
message killed
message activated
end
# ================================================== ======================================
code
newplayer:
player = GetLocalPlayerThing();
Print("Remember as a Werewolf you have the abilities of both Wolf and Man");
SetPulse(1);
Return;
# .................................................. ......................................
pulse:
cursector = GetThingSector(player);
if (GetSectorFlags(cursector) == 0x40000000) // Continues is sector is flagged as moonlight
{
ParseArg(player, "model3d=kd.3do");
ParseArg(player, "puppet=kd.pup");
ParseArg(player, "soundclass=kd.snd");
wolfstatus = 1;
SetInvActivated(player, 116, 1);
PlaySoundThing(WolfActivate, player, 1.0, -1, -1, 0x80);
Print("The Lunar Rays have penetrated your morphogenic memory");
}
Return;
# .................................................. ......................................
killed:
ParseArg(player, "model3d=ky.3do");
ParseArg(player, "puppet=ky.pup");
ParseArg(player, "soundclass=ky.snd");
SetInvActivated(player, 116, 0);
PlaySoundThing(WolfDeactivate, player, 1.0, -1, -1, 0x80);
wolfstatus = 0;
Return;
# .................................................. ......................................
activated:
if (wolfstatus == 0)
{
ParseArg(player, "model3d=kd.3do");
ParseArg(player, "puppet=kd.pup");
ParseArg(player, "soundclass=kd.snd");
wolfstatus = 1;
SetInvActivated(player, 116, 1);
PlaySoundThing(WolfActivate, player, 1.0, -1, -1, 0x80);
Print("You have morphed into a Werewolf");
}
else
if (wolfstatus == 1)
{
ParseArg(player, "model3d=ky.3do");
ParseArg(player, "puppet=ky.pup");
ParseArg(player, "soundclass=ky.snd");
SetInvActivated(player, 116, 0);
PlaySoundThing(WolfDeactivate, player, 1.0, -1, -1, 0x80);
wolfstatus = 0;
Print("You have morphed back into a human");
}
Return;
end
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.