Guidance needed for several explosions (trig., rand., obj)

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
Sgt KIA
Sergeant
Posts: 67
Joined: Fri Sep 19, 2003 7:32 am
Location: Finland
Contact:

Guidance needed for several explosions (trig., rand., obj)

Post by Sgt KIA »

Im about to use explosions on several ways in my map. Here are some general info what i have done so far and willing to do in the future. Ill go to the Qs later.

#1 random (mortar) explosions hitting on certain area.
This obj. has been successfully completed. I use the script from Omaha beach for random mortar fire. If the total number of explosions is essential information, FYI there are atm 18 random hitting spots.

#2 objective: destroy certain model with a bomb.
Ive read tuts at .map and applied the tutorial for another test map. All went ok. However, there might be problems when adding the bomb objective + script for the current map project.

#3 explosion if player triggers mortar shells.
Ive also read Nemesis explosion tut and tested that also on another test map. In the current project the idea is to place couple mortar shells on few locations (maybe 2). One is a pile of unfired shells (just the model and explosion and whats left after the explosion) and the other is a smoking dud that will explode if a player fires (nades) at it.

I tried to add the last one into the current map with the tips from Nemesis and bomb tut at .map. I added a script model for the dud model and the smoke (linger smoke), setting their targetname as exploder and #set number 1. After the explosion there should be no model or smoke left. In the game the game stops at the moment i fire at the dud model. The console says something, but i cant remember what exactly (im not at home atm). I guessed it was someting about available number for explosions or someting like that, like i was already using the maxium amount for different kind of explosions, or the dud explosion is overlapping with the mortar fire (18 explosions).

#4 killing the mortar team (scirpted custom model for AI)
Last thing to do is to add a mortar team. Its a custom model + animation that works fine as a scripted object. My purpose is to make the team to get killed if fired (naded) upon (dead bodies instead). I guess the same principles stated in Nemesis tutorial will apply for this too.

Qs:
- is there a limit for different kind of explosions for a map? Is it possible to add the 4 different explosions at all?
- what kind of approach should i use both in radiant and with the script file for a custom explosion like in #3 or #4? Ie. how to blow up/kill a model without a bomb step like in the bombing tut? I guess i might be using targetnames and scripted modes/objects etc. in a wrong way in the radiant.
Image
Battle for Muna Hill -map
AA version
SH/BT version
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Re: Guidance needed for several explosions (trig., rand., ob

Post by Bjarne BZR »

Sgt KIA wrote:- is there a limit for different kind of explosions for a map? Is it possible to add the 4 different explosions at all?
Should not be a problem. What you describe above sounds like you enter a never ending loop in your script, trying to create explosion at each iteration ( hard to say with the available info tho ).
Sgt KIA wrote:- what kind of approach should i use both in radiant and with the script file for a custom explosion like in #3 or #4? Ie. how to blow up/kill a model without a bomb step like in the bombing tut? I guess i might be using targetnames and scripted modes/objects etc. in a wrong way in the radiant.
You can place a trigger around it and give it a damage threshold. Then call a script piece that tells the exploder to explode ( dont remember the syntax, but its something like $exploder[1] explode )
Admin .MAP Forums
Image
Head above heels.
User avatar
Sgt KIA
Sergeant
Posts: 67
Joined: Fri Sep 19, 2003 7:32 am
Location: Finland
Contact:

Re: Guidance needed for several explosions (trig., rand., ob

Post by Sgt KIA »

Bjarne BZR wrote:.. something like $exploder[1] explode
Thanks.

Ok. So far i finally managed to make the smoking dud triggerable. It works ok and if exploded it cause you damage. Key #set is 1.
The object parts im using have targetnames exploder (dud, smoke), exploderfire, explodersmashed and explodertrigger.

Now what i dont get is, how should i name any other object that can be exploded by a trigger? Is it simpyly #set 2, 3 etc. and same the targetnames or can i use targetnames of my own for exploder and its counterparts?
Image
Battle for Muna Hill -map
AA version
SH/BT version
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Use exploder , exploderfire, explodersmashed and so on again, but increase the #set value. That way you can later do like this:

Code: Select all

$exploder[2] explode
$exploder[3] explode
$exploder[4] explode
// And so on...
Admin .MAP Forums
Image
Head above heels.
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Zoopahdeeahreebeedah! Bjarne's alive! :D

And you cannot do it like this if you're using the exploder script.
global/exploder.scr wrote:// You can create an explodertrigger (with the same #set), or just do "thread global/exploder.scr::explode #" (# being the
// #set value of the exploder in question).
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

Ganpa Simpson wrote:Going off topic in a thread...that's a paddling. Looking out the window...that's a paddling. Staring at my sandals...that's a paddling. Paddling the school canoe...ooh, you better believe that's a paddling.
:)
( Hi Rookie )
Admin .MAP Forums
Image
Head above heels.
User avatar
Sgt KIA
Sergeant
Posts: 67
Joined: Fri Sep 19, 2003 7:32 am
Location: Finland
Contact:

Post by Sgt KIA »

thanks guys.

One more thing. Destroyable objecst now have different #set numbers. If i use the same targetnames for all different objects that also play custom sounds, i get problems (the smoking dud spawns mortar shell launching sound which it is not supposed to do). Well i browsed through some scripting tuts (tltrude's) and found a way to kill the sound entity. It looks and sounds like its actually working

Code: Select all

...exploding code + radiusdamage first...
$mortar_fire_speaker remove
The firing sound stops at the moment the mortar team gets killed (i also use same scripting method to stop the actual mortar firing all over the map, ie. hurt and animation entities will be removed too in the same way). Now this is quite good if the firing sound entity will be back again when the game starts another DM round. I cant test that part. Will that work or should i use another way?
Image
Battle for Muna Hill -map
AA version
SH/BT version
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Why not just stop the sound playback? $mortar_fire_speaker stopsound if you used the playsound command and $mortar_fire_speaker stoploopsound if you used the loopsound command.
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
Post Reply