Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 10 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 MP Mapping
CoD 2 mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: CoD2 - MultiPlayer Mortars
Blimp01
General Member
Since: Jul 23, 2007
Posts: 110
Last: May 12, 2009
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Friday, Jun. 20, 2008 01:47 am
Hi, I've got a normal mortar to explode and create a crater in the ground, but how to i make it so a player hits F, than it explodes. And how can i make it so the player can hit F again, and it will explode again and so on, but the crater will stay after the first boom?
Share |
Blimp01
General Member
Since: Jul 23, 2007
Posts: 110
Last: May 12, 2009
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Friday, Jun. 20, 2008 03:02 am
And also, what line do I put in my script to stop and effect, because i want a mortar to explode, than the crater is on fire for a minute, than the fire goes out.

nullEdit: I mean "to stop an effect" in my first sentance.

edited on Jun. 19, 2008 11:03 pm by Blimp01
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 MP Mapping
Posted: Friday, Jun. 20, 2008 07:48 pm
Have you read the "Moving things" tutorial in the CoD section? A great getting started with scripting tutorial

It deals with triggers and stuff like that. Read it carefully and the, step by step, try to make a script which does what you want.

First make it so when you press "F" the mortar explodes.. then make it so it makes the crater, then make it so the fire starts.. then so the fire stops after a minute.. etc etc..

edit: The key to scripting is taking small steps. Make one thing work, then go on to the next. Do NOT try and make the whole script work at the first time, because you'll only be chasing bugs you can't find because you lost what happens.

edited on Jun. 20, 2008 03:49 pm by The_Caretaker
Share |
Blimp01
General Member
Since: Jul 23, 2007
Posts: 110
Last: May 12, 2009
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Saturday, Jun. 21, 2008 05:47 am
Oh ok thanks now it explodes and leaves fire, and the fire goes away after a few seconds
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
Category: CoD2 MP Mapping
Posted: Saturday, Jun. 21, 2008 10:02 am
Good..

now, if you add a while loop around it all, it will go on every time you press the trigger

It should look something like this:

function()
{
trigger =getent...
while(1)
{
trigger waittill("trigger");
explode
fire
etc
}
}


Everything
Share |
Blimp01
General Member
Since: Jul 23, 2007
Posts: 110
Last: May 12, 2009
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Friday, Jul. 11, 2008 08:22 pm
I need some more help with making a looping mortar that a player hits a trigger for, and it will explode everytime the palayer hits F. I use this script, but I don't know what to add and where to add it to make it a loop.

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();
}
Share |
rob034
General Member
Since: Jan 30, 2007
Posts: 72
Last: Mar 5, 2010
[view latest posts]
Level 3
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
Share |
The_Caretaker
General Member
Since: Jun 8, 2004
Posts: 11625
Last: Jul 7, 2009
[view latest posts]
Level 10
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.
Share |
techno2sl
General Member
Since: Aug 5, 2004
Posts: 2977
Last: Oct 14, 2010
[view latest posts]
Level 9
Category: CoD2 MP Mapping
Posted: Sunday, Jul. 13, 2008 09:30 am
Just an idea but you could just make a trigger_damage over the mortar hole, make the ground as a script exploder, tie it to the trigger and then just worry about the mortar explosion in the .gsc.
Share |
Blimp01
General Member
Since: Jul 23, 2007
Posts: 110
Last: May 12, 2009
[view latest posts]
Level 4
Category: CoD2 MP Mapping
Posted: Sunday, Jul. 13, 2008 09:34 pm
Thanks, The_Caretaker that script worked perfect
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 MP Mapping

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»