V2 Explosion

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
AfterDeath
Corporal
Posts: 26
Joined: Fri Apr 09, 2004 4:34 am
Contact:

V2 Explosion

Post by AfterDeath »

I'm trying to copy the V2 explosion effect. However, looking into obj_team2.scr I can't figure out what part of the coding produces this effect. Here's the code (cleaned up):

Code: Select all

main:
	level waittill prespawn
	
	exec global/DMprecache.scr
	
	exec global/bomber.scr
	
	level.script = maps/obj/obj_team2.scr
	exec global/ambient.scr obj_team2
	
	exec global/door_locked.scr::lock
	thread global/exploder.scr::main
	
	level waittill spawn
	
	level.defusing_team = "axis"
	level.planting_team = "allies"
	level.bomb_damage = 200
	level.bomb_explosion_radius = 2048
	
	level.dmrespawning = 0 // 1 or 0
	level.dmroundlimit = 5 // round time limit in minutes
	level.clockside = axis // set to axis, allies, kills, or draw
	
	level waittill roundstart
	
	thread flyby	
	
	$v2_explode thread global/obj_dm.scr::bomb_thinker
	$ctrlroom_explode thread global/obj_dm.scr::bomb_thinker
	
	thread allies_win_bomb $v2_explode $ctrlroom_explode
	$v2_explode thread axis_win_timer
end
I know it must have something to do with exploder.scr, but I can't understand how it works.

Any ideas?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

exploder

Post by tltrude »

Yes the global/exploder.scr script is what creates the effect.

exec global/exploder.scr::main

The above line sets it all up to wait for the bomb to go off. But the rocket must be targetnamed "exploder" with a key/value, #set 1. The explosion enitity must be named "exploderfire" and have the same #set 1. You can read the little tutorial that is in the exploder script in pak0.pk3.

But, the bomb you set is controled by another script called "global/obj_dm.scr".

global/obj_dm.scr::bomb_thinker


Hope that help a little.
Tom Trude,

Image
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

You should be able to follow most bomb objective tutorials to do this: the only real difference is that you use a script_model object with key: model set to value: static/v2.tik as an exploder, instead og the usual Flak88 model or script_object's...

( all the strange words will make sense once you read the tutorial :) )
Admin .MAP Forums
Image
Head above heels.
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Yes the exploder.scr is called from the obj_dm.scr when the bomb explodes... I think the bomb needs a #exploder_set key for this to work.. anyway see the explode thread in obj_dm.scr.. I may not have all the answers but this script does. ;)
Image
User avatar
G3mInI
First Lieutenant
Posts: 187
Joined: Sat Jun 29, 2002 3:49 am

Post by G3mInI »

Here is how the v2 explosion was created.

Legend:

key - value



The rocket
-------------

script_model

model - static/v2.tik
spawnflags - 1
scale - 0.65
targetname - t17

The bomb
------------

script_model

model - items/pulse_explosive.tik
#exploder_set - 1
$killarea - groundzero
$trigger_name - v2_bomb
target - t17
targetname - v2_explode


3 effects placed inside the v2 static model -- bottom - middle - and near top
------------------------------------------------------------------------

script_model

model - animate/fx_explosion_tank.tik
#set - 1
angle - -1
scale - 4.00
targetname - exploderfire


script_model

model - animate/fx_explosion_tank.tik
#set - 1
angle - -1
scale - 4.00
targetname - exploderfire


script_model

model - animate/fx_explosion_tank.tik
#set - 1
angle - -1
scale - 4.00
targetname - exploderfire


The trigger is a trigger_use place around the bomb (size 30x30x30)
----------------------------------------------------------------------

targetname - v2_bomb


The kill area is a trigger_mulitiple covering the whole area that will cause damage
--------------------------------------------------------------------------

targetname - groundzero


There are also pieces of debris located inside the rocket that target script origins placed outside and above the rocket. Just make small brushes (about 5 or 6) and texture them with something metallic and closely have the same color as the v2 rocket. Select one of the debris brushes and right click and choose script_object. Do this for all the debris brushes you create. Give each debris piece a targetname of 'exploderchunk' minus the quotes of course. Place these 'debris pieces' inside the static rocket model. Select one debris brush and then a script origin and hit ctrl+k. This will connect the two, and you should see a line showing they are connected. This will be the direction the debris piece will fly when the rocket explodes.

That should do it. You should now have near replica of the v2 explosion as seen in the v2 rocket facility stock map.


G3mInI
*Area51*G3mInI****Gen

http://www.area51moh.com
AfterDeath
Corporal
Posts: 26
Joined: Fri Apr 09, 2004 4:34 am
Contact:

Post by AfterDeath »

Thanks a lot G3mInI! I will give that a try as soon as I have some free time :(

BTW I was on Area51's server tonight and saw some of what you made. Very nice stuff man! :wink:

I should be dropping by more often... maybe you'll remember me. Again, thanks :D
=|MoA|= AfterDeath
Men of Action Clan
Post Reply