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.
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 [http://forums.massassi.net/html/smile.gif]](http://forums.massassi.net/html/smile.gif)
[This message has been edited by RaccoonKing (edited October 07, 2000).]
Code:
# 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;
endCould 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 [http://forums.massassi.net/html/smile.gif]](http://forums.massassi.net/html/smile.gif)
[This message has been edited by RaccoonKing (edited October 07, 2000).]