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 → Need simple cog
Need simple cog
2003-03-29, 9:05 AM #1
ive asked this before but no one really replied. i need a cog for when a surface is hit by a weapon and damaged explosions are created at up to 20 ghost positions.

------------------
2003-03-29, 11:23 AM #2
Code:
# SurfExplode.cog
# by DogSRoOL 
# spuds_61520@yahoo.com
# ASuperCheese@AOL.com
# Use "delay" to block the damaged message for a certain period of time after initially being damaged"
# 	(i.e. damage surface, can't damage for "delay" seconds, then damageable again).
# Use "RepeatFactor" to specify whether explosions should only happen once (0) or every time surface is
# damaged (any # other than 0)

symbols
Message      Damaged                                                          
Message      Timer                                                            
Surface      Surf0                              mask=0x408                    
Thing        Ghost00                                                          
Thing        Ghost01                                                          
Thing        Ghost02                                                          
Thing        Ghost03                                                          
Thing        Ghost04                                                          
Thing        Ghost05                                                          
Thing        Ghost06                                                          
Thing        Ghost07                                                          
Thing        Ghost08                                                          
Thing        Ghost09                                                          
Thing        Ghost10                                                          
Thing        Ghost11                                                          
Thing        Ghost12                                                          
Thing        Ghost13                                                          
Thing        Ghost14                                                          
Thing        Ghost15                                                          
Thing        Ghost16                                                          
Thing        Ghost17                                                          
Thing        Ghost18                                                          
Thing        Ghost19                                                          
template     exp=+03_exp                                               
int          i                                  local                         
int          repeatfactor=0                                                   
int          blocked=0                          local                         
flex         delay=5.0                                                        
end                                                                           

code
Damaged:
	if(blocked >= 1) return;
	if(repeatfactor==0) blocked=2;
	else { blocked=1; if(delay > 0) SetTimer(delay); }
	for(i=0; i<=19; i=i+1)
	{
		if(Ghost00 > -1) CreateThing(exp, ghost00);
	}
	Return;

Timer:
	Blocked=0;
	Return;

end


enjoy [http://forums.massassi.net/html/wink.gif]
(BTW, I actually decided to test this cog, so I'm sure it works.)
------------------
May the forks be with you.

[This message has been edited by DogSRoOL (edited March 29, 2003).]
Catloaf, meet mouseloaf.
My music
2003-03-29, 2:52 PM #3
omg thank you!!!!!!! thank you thank you!

------------------
2003-03-29, 7:13 PM #4
[http://forums.massassi.net/html/cool.gif]

------------------
May the forks be with you.
Catloaf, meet mouseloaf.
My music

↑ Up to the top!