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 → Trap Forcefields
Trap Forcefields
2004-04-24, 3:06 PM #1
This cog works, I just need to make it where forcefields are turned on when a switch is pushed, and then turn off after a certain amount of time. Could someone add the code in my cog to make this work please. I tried it once and screwed up the whole cog...
2004-04-24, 3:17 PM #2
Code:
symbols
surface	switch			desc=switch
surface	switch2			desc=switch
thing		tb1			nolink,desc=tdg1
thing		tb2			nolink,desc=tdg2
thing		tb3			nolink,desc=tdg3
thing		tb4			nolink,desc=tdg4
thing		tb5			nolink,desc=tdg4
thing		tb6			nolink,desc=tdg4
thing		tb7			nolink,desc=tdg4
thing		tb8			nolink,desc=tdg4
thing		tb9			nolink,desc=tdg4
thing		tb9a			nolink,desc=tdg4
int		rounds=9		desc=rounds
flex		rate=0.1		desc=rate
flex		delay=3.0	desc=delay
int		firing=0		local
int		cur_round=0	local
int		dummy			local
template	proj_tpl=+force_lightning4   local
sound		on_snd=set_hi2.wav	local
sound		off_snd=lgclick1.wav	local
sound         lightning
message		activated
end


------------------
Fear, It Controls The Fearful. The Strong. The Weak. The Innocent. Fear Is My Ally!

The Arcane Sith
2004-04-24, 3:18 PM #3
[YEah, post the code too....]

------------------
I used to believe that we must fight the future, lest change come without our consent. I was wrong. The truth is that we must embrace the future, for only with change can we remain the same.

[This message has been edited by GBK (edited April 24, 2004).]

[This message has been edited by GBK (edited April 24, 2004).]
And when the moment is right, I'm gonna fly a kite.
2004-04-24, 3:36 PM #4
Errr...Yeah, sorry bout that, I'm having some pc difficulties so I asked mysterious to post it.

------------------
Fear, It Controls The Fearful. The Strong. The Weak. The Innocent. Fear Is My Ally!

The Arcane Sith
2004-04-24, 3:41 PM #5
Keith sent me the cog and so i am going to post it....

Code:
#gincenerator.cog
#Cog for incenerator.
#Modified M2_dettrap.
#Not Supported By LucasArts Entertainment Co.
# ========================================================================================

symbols

surface	switch			desc=switch
surface	switch2			desc=switch

thing		tb1			nolink,desc=tdg1
thing		tb2			nolink,desc=tdg2
thing		tb3			nolink,desc=tdg3
thing		tb4			nolink,desc=tdg4
thing		tb5			nolink,desc=tdg4
thing		tb6			nolink,desc=tdg4
thing		tb7			nolink,desc=tdg4
thing		tb8			nolink,desc=tdg4
thing		tb9			nolink,desc=tdg4
thing		tb9a			nolink,desc=tdg4

int		rounds=9		desc=rounds

flex		rate=0.1		desc=rate
flex		delay=3.0	desc=delay

int		firing=0		local
int		cur_round=0	local
int		dummy			local

template	proj_tpl=+force_lightning4   local

sound		on_snd=set_hi2.wav	local
sound		off_snd=lgclick1.wav	local
sound         lightning

message		activated

end

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

code

activated:
	if(firing == 1) Return;

	firing = 1;
	dummy = SetWallCel(switch, 1);
	dummy = PlaySoundPos(on_snd, SurfaceCenter(switch), 1.0, 5.0, 10.0, 0);
	dummy = SetWallCel(switch2, 1);
	dummy = PlaySoundPos(on_snd, SurfaceCenter(switch2), 1.0, 5.0, 10.0, 0);	

	cur_round = 0;
	while(cur_round < rounds)
	{
        PlaySoundThing(lightning, tb1, 1.0, 10.0, 20.0, 0);
	 dummy = CreateThing(proj_tpl, tb1);
	 Sleep(rate);
        PlaySoundThing(lightning, tb1, 1.0, 10.0, 20.0, 0);
	 dummy = CreateThing(proj_tpl, tb2);
	 Sleep(rate);
        PlaySoundThing(lightning, tb1, 1.0, 10.0, 20.0, 0);
	 dummy = CreateThing(proj_tpl, tb3);
	 Sleep(rate);
        PlaySoundThing(lightning, tb1, 1.0, 10.0, 20.0, 0);
	 dummy = CreateThing(proj_tpl, tb4);
	 Sleep(rate);
        PlaySoundThing(lightning, tb1, 1.0, 10.0, 20.0, 0);
	 dummy = CreateThing(proj_tpl, tb5);
	 Sleep(rate);
        PlaySoundThing(lightning, tb1, 1.0, 10.0, 20.0, 0);
	 dummy = CreateThing(proj_tpl, tb6);
	 Sleep(rate);
        PlaySoundThing(lightning, tb1, 1.0, 10.0, 20.0, 0);
	 dummy = CreateThing(proj_tpl, tb7);
	 Sleep(rate);
        PlaySoundThing(lightning, tb1, 1.0, 10.0, 20.0, 0);
	 dummy = CreateThing(proj_tpl, tb8);
	 Sleep(rate);
        PlaySoundThing(lightning, tb1, 1.0, 10.0, 20.0, 0);
	 dummy = CreateThing(proj_tpl, tb9);
	 Sleep(rate);
        PlaySoundThing(lightning, tb1, 1.0, 10.0, 20.0, 0);
	 dummy = CreateThing(proj_tpl, tb9a);
	 Sleep(rate);


	 cur_round = cur_round + 1;
	}

	Sleep(delay);
	dummy = SetWallCel(switch, 0);
	dummy = PlaySoundPos(off_snd, SurfaceCenter(switch), 1.0, 5.0, 10.0, 0);
	dummy = SetWallCel(switch2, 0);
	dummy = PlaySoundPos(off_snd, SurfaceCenter(switch), 1.0, 5.0, 10.0, 0);
	firing = 0;
	Return;

end


How to add forcefields when the trap is going on is what he wants to know.

------------------
"The quality of the levels you make is determined by the skill of the person not by the editor in which they use!"
-Michael Kyle

↑ Up to the top!