bombs

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
Daniel Radcliffe
Second Lieutenant
Posts: 168
Joined: Fri May 30, 2003 9:49 am

bombs

Post by Daniel Radcliffe »

I after several bombs in my map which are used to gain entry to certain areas of the map as well as an objective bomb.

The obj works fine, but i have the problem with the bombs used to gain entry in that they all work well for the allies, however, i do not want the axis to be able to plant these bombs which atm they cant do. They can however still set the trigger off without setting the bomb off and so making the trigger disappear and preventing the axis from being able to plant the bomb and gain entry.

Here is part of my script that is relevant.

bomb1_start:
$door1_trigger waittill trigger
$door1_trigger playsound plantbomb

local.player = parm.other
$door1_nopulse playsound plantbomb
$door1_pulse hide

if (local.player.dmteam != axis)
{
goto door1
}

end

door1:
$door1_trigger playsound plantbomb
$door1_nopulse show
$door1_pulse hide
local.player = parm.other
local.player stopwatch 5
$door1_nopulse playsound plantbomb
wait .5
$door1_nopulse loopsound final_countdown
wait 5
$door1_nopulse stoploopsound
radiusdamage $door1_nopulse.origin 120 256
thread jitter_large
$door1_explosion_fx anim start
$door1 remove
$door1_off show
$door1_nopulse remove
$door1_pulse remove
iprintlnbold "Allies have gained access to the passages"
Can someone help me please.

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

Post by Bjarne BZR »

Something like this... you must repeat the trigger wait until the triggerer is an allied. THEN you blow it:

Code: Select all

some_label_name_that_was_omitted_from_your_script:
	//  Some code
	//  Some more code
	while(1) //forever
	{
		$door1_trigger waittill trigger
		local.player = parm.other
		if (local.player.dmteam != axis)
		{
			goto door1
		}
	}
end

door1:
	$door1_trigger playsound plantbomb
	$door1_pulse hide
	$door1_nopulse show
	local.player = parm.other
	local.player stopwatch 5
	$door1_nopulse playsound plantbomb
	wait .5
	$door1_nopulse loopsound final_countdown
	wait 5
	$door1_nopulse stoploopsound
	radiusdamage $door1_nopulse.origin 120 256
	thread jitter_large
	$door1_explosion_fx anim start
	$door1 remove
	$door1_off show
	$door1_nopulse remove
	$door1_pulse remove
	iprintlnbold "Allies have gained access to the passages"
end
Admin .MAP Forums
Image
Head above heels.
Daniel Radcliffe
Second Lieutenant
Posts: 168
Joined: Fri May 30, 2003 9:49 am

Post by Daniel Radcliffe »

Yep, that sorted it.

thx

Now my next question is what does that say :? as ill need to know for future reference. :)
Bjarne BZR
Site Admin
Posts: 3298
Joined: Wed Feb 05, 2003 2:04 pm
Location: Sweden
Contact:

Post by Bjarne BZR »

You mean what I changed? Well:

I set the waiting of the trigger in an eternal loop. Because as long as an allied is not the triggerer, you should wait for another trigger.

Another error you did was that as soon as the trigger was fired, you played the sound and removed the trigger: the correct way is to first test that is IS an allied triggerer, and THEN play the sounds and replace the models.
Admin .MAP Forums
Image
Head above heels.
Daniel Radcliffe
Second Lieutenant
Posts: 168
Joined: Fri May 30, 2003 9:49 am

Post by Daniel Radcliffe »

Ahh, ok.

Thx for you help and explaining what was changed.
Post Reply