| Author |
Topic: CoD2 - MultiPlayer Mortars |
| Blimp01 |
 |
General Member Since: Jul 23, 2007 Posts: 110 Last: May 12, 2009 [view latest posts] |
|
|
|
|
| Blimp01 |
 |
General Member Since: Jul 23, 2007 Posts: 110 Last: May 12, 2009 [view latest posts] |
|
|
|
|
| The_Caretaker |
General Member Since: Jun 8, 2004 Posts: 11625 Last: Jul 7, 2009 [view latest posts] |
|
|
|
|
| Blimp01 |
 |
General Member Since: Jul 23, 2007 Posts: 110 Last: May 12, 2009 [view latest posts] |
|
|
|
|
| The_Caretaker |
General Member Since: Jun 8, 2004 Posts: 11625 Last: Jul 7, 2009 [view latest posts] |
|
|
|
|
| Blimp01 |
 |
General Member Since: Jul 23, 2007 Posts: 110 Last: May 12, 2009 [view latest posts] |
|
|
|
|
| rob034 |
General Member Since: Jan 30, 2007 Posts: 72 Last: Mar 5, 2010 [view latest posts] |
|
|
|
Category: CoD2 MP Mapping Posted: Saturday, Jul. 12, 2008 11:40 am |
 |
I think you need to place the function line in the message above around your script. In this way you will assign the script to the action.
In Radiant you need to make a trigger_use around where you want it to appear in your map. Lets give it a targetname: mortar
You need to define this trigger in the getent.... Now when you press the trigger it allows your script to be executed. So it would look something like this if we combine the 2.
Code:
main()
{
level._effect["mortexplosion01"] = loadfx("fx/explosions/artilleryExp_dirt_brown.efx");
}
function()
{
trigger =getent("mortar","targetname");
while(1)
{
trigger waittill("trigger");
thread mortar1();
}
mortar1()
{
action = getent ("action","targetname");
botground = getent ("botlayer","targetname");
topground = getent ("toplayer","targetname");
trigger = getent ("morttrig","targetname");
botground hide();
trigger waittill ("trigger");
origin = action getorigin();
action playsound("incoming_mortar");
wait (1);
action playsound("explosion_ground");
playfx(level._effect["mortexplosion01"], origin);
botground show();
topground delete();
}
}
I am not 100% sure if it will work like this but its a start.
Good luck |
 |
|
|
| The_Caretaker |
General Member Since: Jun 8, 2004 Posts: 11625 Last: Jul 7, 2009 [view latest posts] |
|
|
|
Category: CoD2 MP Mapping Posted: Sunday, Jul. 13, 2008 09:05 am |
 |
No need to do it like that, if fact.. it's very bad to do it like that, because the function mortar1() will be called over and over and over again like that, most likely causing memory errors.
Read my post above.. everything you post between a while(1) loop ill keep on repeating.
Now, because you have your ground disappearing, you don't want that to happen every time.. So after it disappears., add a while loop with the trigger, explosion and everything in it... like so
main()
{
level._effect["mortexplosion01"] = loadfx("fx/explosions/artilleryExp_dirt_brown.efx");
thread mortar1();
}
mortar1()
{
action = getent ("action","targetname");
botground = getent ("botlayer","targetname");
topground = getent ("toplayer","targetname");
trigger = getent ("morttrig","targetname");
botground hide();
trigger waittill ("trigger");
origin = action getorigin();
action playsound("incoming_mortar");
wait (1);
action playsound("explosion_ground");
playfx(level._effect["mortexplosion01"], origin);
botground show();
topground delete();
while(1)
{
trigger waittill ("trigger");
origin = action getorigin();
action playsound("incoming_mortar");
wait (1);
action playsound("explosion_ground");
playfx(level._effect["mortexplosion01"], origin)
}
}
This way, the first time you press the trigger, the mortar blasts the hole in the ground, then the script enters the while loop, and keeps on firing the mortar every time the trigger is pressed. |
 |
|
|
| techno2sl |
 |
General Member Since: Aug 5, 2004 Posts: 2977 Last: Oct 14, 2010 [view latest posts] |
|
|
|
|
| Blimp01 |
 |
General Member Since: Jul 23, 2007 Posts: 110 Last: May 12, 2009 [view latest posts] |
|
|
|
|
|
|
mp_TempleCall of Duty: Mods: Multiplayer (624.12Kb)
|