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 → why wont this cog work? :(
why wont this cog work? :(
2001-04-26, 10:33 AM #1
I downloaded this cog right here at massassi for blowing up a designated object, but in the placed cogs menu it wont let me enter any values for thing, etc. Can anyone see anything wrong with it? If not, can someone write me a simple cog for blowing up an object (object takes certain amount of damage, then explosion w./debris and then destroys thing). Thanks.
# Jedi Knight Cog Script
#
# XTANK1.COG
#
# This cog causes an attached object to explode if damaged sufficiently
#
# 5/23 - RKD - Removed buggy "remains" element
# 5/30 - YB - Don't explode if hit by fists.
# 7/7 - CR - Converted to actor cog
# Added delay in exploding
# 7/7 - YB - Rewrote the script to use thing user data
# 7/8 - CR - Adjusted delay, fixed damage test, marked issue closed [http://forums.massassi.net/html/smile.gif]
# 7/25 - YB - Made execution mode SERVER | SYNC
# 8/26 - RKD - Added killtimerex to fix bug
#
# (C) 1997 LucasArts Entertainment Co. All Rights Reserved
# 4/98 -DAK- Changed Cog for use with grating.

flags=0x80

symbols

message created
message damaged
message timer

template barrel_exp=+debris_exp local
int barrel local
flex barrelhealth local
flex damage local

end

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

code

created:
SetThingUserData(GetSenderRef(), 30); // set the initial user data (i.e. "health")
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.5, barrel, 0, 0); // prepare to kill the barrel in 0.6 second
Return;
}

SetThingUserData(barrel, barrelhealth - damage);
Return;

# ............................................................................................

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

end



[This message has been edited by Joshua (edited April 26, 2001).]
"Flash like daybreak to the fray"
Raccoonking: Deeznuts are tasty!http://www.geocities.com/joshroxby/
2001-04-26, 10:46 AM #2
Remove the locals. [http://forums.massassi.net/html/smile.gif]

------------------
Gravity isn't MY fault--I voted for velcro.
Gravity isn't MY fault--I voted for velcro.
2001-04-26, 2:28 PM #3
Ok. Thanks. Now the parameters are showing up but when I filled them out the object doesnt blow up in the game. I put a health of 1 and a damage (?) of 10 (didnt know what to put for this). Any ideas?
"Flash like daybreak to the fray"
Raccoonking: Deeznuts are tasty!http://www.geocities.com/joshroxby/
2001-04-26, 3:47 PM #4
This cog is for a template thing that is attached to another thing (3do). I think you need to make several changes for a cog to blow up a stand-alone thing. If you can figure out what cog is used for blowing up the barrel things in JK then you can modify that.

------------------
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton
Sylvicolus JK homepage
If I have ever made any valuable discoveries, it has been owing more to
patient observation than to any other reason. -Isaac Newton

↑ Up to the top!