Page 1 of 1

Random Explosion

Posted: Sun Aug 29, 2004 7:11 pm
by strafer
I am creating random explosions in Snowy Park and I am having a small problem. I got the explosions animations to work, but it doesn't do any damage. Here is my script:

Code: Select all

// SNOWY PARK
// ARCHITECTURE: NED
// SCRIPTING: NED

main:

// set scoreboard messages
setcvar "g_obj_alliedtext1" "Snowy Park"
setcvar "g_obj_alliedtext2" ""
setcvar "g_obj_alliedtext3" ""
setcvar "g_obj_axistext1" ""
setcvar "g_obj_axistext2" ""
setcvar "g_obj_axistext3" ""

setcvar "g_scoreboardpic" "mohdm5"

	// call additional stuff for playing this map round based is needed
	if(level.roundbased)
		thread roundbasedthread

	level waitTill prespawn

	//*** Precache Dm Stuff
	exec global/DMprecache.scr

	level.script = maps/dm/mohdm5.scr
	exec global/ambient.scr mohdm5





	level waittill spawn

	thread re1


snow:
	wait 1

	level.rain_speed = "32"
	level.rain_speed_vary = "16"
	level.rain_length = "2"
	level.rain_width = "1"
	level.rain_density = ".2"
	level.rain_slant = "250"
	level.rain_min_dist = "1800"
	//level.rain_min_dist = "512"
	level.rain_numshaders = 12
	level.rain_shader = "textures/snow0"


end

re1:

local.exp1wait = randomint (45) + 15
println local.exp1wait
println local.exp1wait

wait local.exp1wait

local.rexp1 = spawn "fx/scriptbazookaexplosion.tik"
local.rexp2 = spawn "animate/fx_mortar_dirt.tik"
local.rexp3 = spawn "animate/fx_mortar_higgins.tik"

exec global/earthquake.scr .30 6 0 0
local.rexp1.origin = ( 4692 -4015 157 )
local.rexp1 anim start
local.rexp2.origin = ( 4692 -4015 157 )
local.rexp2 anim start
local.rexp3.origin = ( 4692 -4015 157 )
local.rexp3 anim start
wait 1
local.rexp1 remove
local.rexp2 remove
local.rexp3 remove

	goto re1

end

//-----------------------------------------------------------------------------

roundbasedthread:

	// Can specify different scoreboard messages for round based games here.

	level waitTill prespawn

	level waittill spawn

	// set the parameters for this round based match
	level.dmrespawning = 0 // 1 or 0
	level.dmroundlimit = 5 // round time limit in minutes
	level.clockside = kills // set to axis, allies, kills, or draw

	level waittill roundstart

end
I also have tried this:

Code: Select all

re1:

local.exp1wait = randomint (45) + 15
println local.exp1wait
println local.exp1wait

wait local.exp1wait

local.rexp1 = spawn "fx/scriptbazookaexplosion.tik"
local.rexp2 = spawn "animate/fx_mortar_dirt.tik"
local.rexp3 = spawn "animate/fx_mortar_higgins.tik"

exec global/earthquake.scr .30 6 0 0
local.rexp1.origin = ( 4692 -4015 157 )
local.rexp1 anim start
local.rexp2.origin = ( 4692 -4015 157 )
local.rexp2 anim start
local.rexp3.origin = ( 4692 -4015 157 )
local.rexp3 anim start
radiusdamage local.rexp1.origin 500 500
wait 1
local.rexp1 remove
local.rexp2 remove
local.rexp3 remove

	goto re1

end
Thanks in advance.

Posted: Sun Aug 29, 2004 7:37 pm
by Bjarne BZR
I did this:

Code: Select all

explode_target local.a_script_origin:
	println "[threadStart] explode_target"
	local.Exp1 = spawn "fx/scriptbazookaexplosion.tik"
	local.Exp2 = spawn "animate/fx_mortar_dirt.tik"
	local.Exp3 = spawn "animate/fx_mortar_higgins.tik"

	wait 1

	exec global/earthquake.scr .3 2 0 0

	local.Exp1.origin = local.a_script_origin.origin
	local.Exp1 anim start

	local.Exp2.origin = local.a_script_origin.origin
	local.Exp2 anim start

	local.Exp3.origin = local.a_script_origin.origin
	local.Exp3 anim start

	wait 1

	local.Exp1 remove
	local.Exp2 remove
	local.Exp3 remove
end
...with good results.

Posted: Sun Aug 29, 2004 7:48 pm
by strafer
Thanks for your response, but I figured out what I did wrong...I guess they were spawning a little under the map so the damage didn't go through the ground. I just raised the origin.

I just love it when I make stupid mistakes like this. :lol:

Posted: Sun Aug 29, 2004 9:06 pm
by strafer
I am creating an artillery barrage for snowy park and I, of course, am running into a problem that is giving me a headache. If I could send someone the script and they could look at it, it would be greatly appreciated. If someone were to look at it, I want it to be someone I know will not take this for his own or anything like that (Like Bjarne BZR, bdbodger or any other site admin that is good at scripting. If any of you are willing to look at this please tell me where to send it to you. From there I will tell you how I set it up and I will send you the .scr file.

Just to tell you, there are 692 lines of code in it so it may be a while.

If no one wants to I understand why. If so then thank you for taking the time to help me.

Posted: Sun Aug 29, 2004 10:02 pm
by Bjarne BZR
692 lines? Whats wrong with you? ;)

Send it to me, but I cant guatantee I'll read it all :roll:

See the little "email" button below?