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 → Quick Cog Help
Quick Cog Help
2002-01-24, 2:22 PM #1
basically , i am trying to write a cog that is a force power but allows charging up like the bowcaster , and depending on charge it fires a more or less powerful projectile from an array of say 4.

i've been trying to modify the destruct cog to do that , but not being successful.

[and yes , i know 's very weird having mousie ask for cogging help (:]
Also, I can kill you with my brain.
2002-01-25, 11:10 AM #2
I'll try to outline a system.

Put this in the symbols for the array:
Code:
template	temp0=temp1		local
template	temp1=temp2		local
template	temp2=temp3		local
template	temp3=temp4		local


And as for the code:

Code:
#----------------------------------------------------------------
activated:
	// Other code
	power=0;
	SetPulse(0.5);

Return;
#----------------------------------------------------------------
pulse:
	power=power+1;
	if(power == 3) SetPulse(0);

Return;
#----------------------------------------------------------------
deactivated:
	// Other fire code
	SetPulse(0);
	FireProjectile(player, temp0[power], fireSound, 8, etc..);
	// Other fire code

Return;
#----------------------------------------------------------------


Basically, the pulse is started when the key is pressed and the "power" of the weapon increments every half second. When the player releases the key, FireProjectile() will use power to locate the right template in the array to use. If the player simply taps the key, then the first template will be used.

Good luck [http://forums.massassi.net/html/wink.gif]

------------------
More matter with less art.

[This message has been edited by SaberMaster (edited January 25, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!