Help explotion...

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Help explotion...

Post by Barttje »

Hi all,

I'm trying to put an trigger somewhere and if i'm using it than it will explode over 15 seconds by the local.player... i have the trigger but and its working but the explosion doesn't work...

Here is my code...


level waittill prespawn


local.Bomboom = spawn script_model "targetname" "bom_boom"
local.Bomboom model "animate/fx_mortar_dirt.tik"

local.Bomboom.origin = local.player.origin
local.Bomboom.angles = ( 0 0 0 )
local.Bomboom.scale = 1



level waittill spawn

local.Bom = spawn trigger_use
local.Bom.origin = ( 2458 488 -495 )
local.Bom setsize ( -10 -10 -10 ) ( 10 10 10 )
local.Bom setthread Bom
local.Bom message "You bloody bastard"
local.Bom delay 0

end

Bom:
while(isAlive local.player)
{
$Bom waittill trigger
self nottriggerable
local.player = parm.other
local.player stufftext "say Oh no... I'm a bloody bastard, and can explode every moment!!!"
$player playsound plantbomb1
wait 15
$bom_boom anim start

$player hurt 9999
self triggerable
break
}
end


The yellow line is what I think what is wrong, but I don't know what i have to set... please tell me :)
TnX
Last edited by Barttje on Sun Feb 26, 2006 2:14 pm, edited 1 time in total.
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

parm.other

Post by tltrude »

The explosion does not know who local.player is. So, move all the red and yellow lines under where it say:

local.player = parm.other

and above the stufftext line.

Also change $player to local.player . If you add these lines after the explosion animation, it will seem more real.

waitexec global/earthquake.scr .3 1.5 0 0
waitexec global/earthquake.scr .35 .75 0 0


By the way, everything you are looking for is in the global/minefield.scr script. And, the player will be thrown up into the air.

//*** minefield script
//*** The player enters the minefield, and within a short random amount of time
//*** if he's still in the minefield he'll blow himself up and crush his skull.
//*** This main thread is called by this script and should not be called by the
//*** level script itsself. The level script should call minefield_setup
//*** syntax ------------------------------------
//*** minefield <this is the index number for the array of minefield triggers>
Tom Trude,

Image
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

Tnx tltrude ive learned from that :D ... he is doing it now :) ... but:


Bom:
while(isAlive local.player) //<-- this one isn't still doing it... if i do while(1) then he's doing it :?
{
$Bom waittill trigger
self nottriggerable
local.player = parm.other
local.player stufftext "say Oh no... I'm a bloody bastard, and can explode every moment!!!"
$player playsound plantbomb1
wait 15
$bom_boom anim start
$player hurt 9999
self triggerable
break
}
end
Green Beret
Major General
Posts: 746
Joined: Mon Apr 19, 2004 12:21 pm
Contact:

Post by Green Beret »

I think the while is alive checks to see if the player is dead.
I would add that maybe at the end?
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

local.player

Post by tltrude »

local.player is a variable and must have value before it is used. This line gives it value.

local.player = parm.other
Last edited by tltrude on Sun Feb 26, 2006 4:49 pm, edited 1 time in total.
Tom Trude,

Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

local.player = pram.other // <-- I think this should be parm.other :)
Image
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

tltrude wrote:local.player is a variable and must have value before it is used. This line gives it value.

local.player = parm.other
you mean this?

Code: Select all

Bom:
	local.player = parm.other
  while(isAlive local.player) 
    { 
	$Bom waittill trigger 
	self nottriggerable 
 

	local.player stufftext "say Oh no... I'm a bloody bastard, and can explode every moment!!!"
	local.player playsound plantbomb1
	 wait 15
	local.Bomboom = spawn script_model "targetname" "bom_boom"
	local.Bomboom model "animate/fx_mortar_dirt.tik"
	local.Bomboom.origin = local.player.origin
	local.Bomboom.angles = ( 0 0 0 )
	 wait .5

	waitexec global/earthquake.scr .3 1.5 0 0 
	waitexec global/earthquake.scr .35 .75 0 0

	$bom_boom anim start
	local.player hurt 9999
	self triggerable
	break
    }
end

oh and BTW...
waitexec global/earthquake.scr .3 1.5 0 0
waitexec global/earthquake.scr .35 .75 0 0
what does it all means?
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

earthquake

Post by tltrude »

the earthquake lines should be after the animation line. Although, it is so fast you may not notice a difference. Here is what the numbers mean.

duration, magnitude, no_rampup, no_rampdown

Duration = how long it will last.
Magnitude = how strong the shaking is.
No_rampup = not sure, but could limit shaking as it builds to a peak.
No_rampdown = not sure, but could limit shaking as it fades away.

Btw, your english is bad in the message.

"Oh no!.. I'm a bloody bastard, and can explode at any moment!!!"
Tom Trude,

Image
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

srry for my bad english, tnx for the good english and tnx for the explain of earthquake...


okeey i just completed the script and its working but
local.Bomboom = spawn script_model "targetname" "bom_boom"
local.Bomboom model "animate/fx_mortar_dirt.tik"
local.Bomboom.origin = local.player.origin

local.Bomboom damage = 999
local.Bomboom explosion_radius = 400



whats wrong, he isn't doing the damage...??????
Barttje
Sergeant Major
Posts: 111
Joined: Sat Aug 20, 2005 8:52 pm

Post by Barttje »

nver mind... I figured it out... :)
tnx for help anyway :D
Post Reply