PDA

View Full Version : 3d explosion cog for more than one explosion?



GuNbOy
10-23-2000, 03:20 PM
# 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?

R_ivi_N
10-23-2000, 03:55 PM
HAHAHA, GuNbOy sux0rs!! http://forums.massassi.net/html/smile.gif

------------------
It's better to be looked over than over-looked.

GuNbOy
10-23-2000, 03:56 PM
lets see you cog it Riv.

Deathbane27
10-23-2000, 04:02 PM
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:



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 (http://www.jediassassins.f2s.com/)

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