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 → 3d explosion cog for more than one explosion?
3d explosion cog for more than one explosion?
2000-10-23, 12:20 PM #1
Code:
# Jedi Knight Cog Script
#
# exp_shock.cog - 3d explosion
#
# changes the 3do of whatever "thing" is into the models listed.
#
# make sure you add a +shockwave or somthing to your templates
# it should have been created by the explosion template for your weapon, AND have 
# "model3d=shock.3do cog=exp_shock.cog" included in it.
#
# [GunBoy]
#
# 

flags=0x240

symbols

model		exp0=shock1.3do				local
model		exp1=shock2.3do				local
model		exp2=shock3.3do				local
model		exp3=shock4.3do				local
model		exp4=shock5.3do				local

material	mat0=purpleglow.mat			local
material	mat01=bluecore.mat			local

thing		shock					local

int		matindex				local

message     created


end

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

code
created:
	for (matindex=0; matindex <= 2; matindex = matindex + 1)
		{
		MaterialAnim(mat0[matindex], 100, 1);
		}
	shock=GetSenderRef();

	SetThingModel(shock, exp0);
	Sleep(0.05);
	SetThingModel(shock, exp1);
	Sleep(0.05);
	SetThingModel(shock, exp2);
	Sleep(0.05);
	SetThingModel(shock, exp3);
	Sleep(0.05);
	SetThingModel(shock, exp4);
	Sleep(0.05);

	DestroyThing(shock);
	Return;

end   



right now, it only works for one "shock" at a time, is there a way to make it work for say up to 4? or 6? since its for MP that would be ugly to have one of the explosions just stop in mid air, could i use more Things or somthing?
I'm just an old man with a skooma problem.
2000-10-23, 12:55 PM #2
HAHAHA, GuNbOy sux0rs!! [http://forums.massassi.net/html/smile.gif]

------------------
It's better to be looked over than over-looked.
"She turned me into a newt!"
Pause
"Well I got better..."
2000-10-23, 12:56 PM #3
lets see you cog it Riv.
I'm just an old man with a skooma problem.
2000-10-23, 1:02 PM #4
Let's see... The problem is that the variable "shock" is changed every time a new thing is created... so you have to use a timer or a pulse. New cog:

Code:
flags=0x240

symbols

model		exp0=shock1.3do				local
model		exp1=shock2.3do				local
model		exp2=shock3.3do				local
model		exp3=shock4.3do				local
model		exp4=shock5.3do				local

material	mat0=purpleglow.mat			local
material	mat01=bluecore.mat			local

int		shock					local

int		matindex				local

message     created
message     pulse

end

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

code
created:
	for (matindex=0; matindex <= 2; matindex = matindex + 1)
		{
		MaterialAnim(mat0[matindex], 100, 1);
		}
	SetThingPulse(GetSenderRef(), 0.05);
        Return;

pulse:
        shock=shock+1;
	if(shock>=4) DestroyThing(GetSenderRef());
	SetThingModel(GetSenderRef(), exp0[shock]);
	Return;

end   


Changes: changed shock to an int for array control, added 'pulse' message.

[http://forums.massassi.net/html/smile.gif]

------------------
Deathbane27, Massassi's favorite hater-hater.
Out to bring the -ians and -ites closer together. (So I can cut 'em all down in one swipe!)
Jedi Assassins

[This message has been edited by Deathbane27 (edited October 23, 2000).]

↑ Up to the top!