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 → Templates only working properly for host in mp
Templates only working properly for host in mp
2001-05-25, 8:43 AM #1
This is indirrectly related to cog

This worked fine for me testing on my own machine but online it only workes for the host machine.
The trap is a server/client trap cog which
works properly. The trap drops bombs around which should explode after a few seconds OR if while bouncing around they are inflicted with enough damage to set them off. For the nonhost however they are not disappearing. They just keep accumulating each time the trap is activated.

So I beleive the templates are flawed and causing this multiplayer bug...so here are the templates I've added that function allng with the bomb trap...

# DESC:
# BBOX: -.04 -.04 -.04 .04 .04 .04
boom _weapon size=.045466 movesize=.045466 model3d=boom.3DO thingflags=0x48 collide=1 move=physics physflags=0x4221
# DESC:
# BBOX: -.04 -.03 -.05 .04 .03 .05
+boom _throwable2 model3d=boom.3DO size=.045466 movesize=.045466 soundclass=boom.snd surfdrag=3 airdrag=1 mass=10 thingflags=0x48 collide=1 move=physics physflags=0x4221 vel=(-.2/.15/1) angvel=(60/45/125) buoyancy=.25 cog=killerdet.cog explode=+boom_exp fleshhit=+boom_exp damageclass=0x4 typeflags=0x40309
# DESC:
# BBOX: 0 0 0 0 0 0
_throwable2 none orient=(0/0/0) type=debris thingflags=0x48 collide=1 move=physics movesize=.01 surfdrag=3 airdrag=1 mass=10 height=.011 physflags=0x4221 buoyancy=.25
# DESC:
# BBOX: 0 0 0 0 0 0
+boom_exp _explosion thingflags=0x1 light=.2 timer=.8 sprite=tiex.spr soundclass=exp_tie.snd creatething=+firecloud typeflags=0x17 damage=125 blasttime=.699 force=100 maxlight=.8 range=.65


Any suggestions would be greatly appreciated!
2001-05-25, 8:49 AM #2
Ah yes...and the cog that +boom refers to killerdet.cog is here. Perhaps this is the problem? I really dont know. Does the flag need to be different at the top?

# Jedi Knight Cog Script
#

flags=0x80

symbols

message created
message damaged
message timer

template barrel_exp=+boom_exp local
int barrel local

flex barrelhealth local


end

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

code

created:
SetThingUserData(GetSenderRef(), 5); // set the initial user data (i.e. "health")
barrel = GetSenderRef();

{
SetTimerEx(3.5, barrel, 0, 0); // prepare to kill the barrel in 3.5 second
Return;
}

Return;

damaged:
barrel = GetSenderRef();
damage = GetParam(0);
barrelhealth = GetThingUserData(barrel);

if(GetParam(1) == 1) Return; // barrel won't be damaged by damage type impact

if(barrelhealth <= damage) // is this enough damage to kill the barrel ?
{
SetTimerEx(0.2, barrel, 0, 0); // prepare to kill the barrel in 0.2 second
Return;
}

SetThingUserData(barrel, barrelhealth - damage);
Return;
# ............................................................................................

timer:
KillTimerEx(GetSenderId());
CreateThing(barrel_exp, GetSenderId()); // create an explosion
DestroyThing(GetSenderId()); // Destroy the barrel
Return;

end

↑ Up to the top!