targetname of bomb

Post your scripting questions / solutions here

Moderator: Moderators

Locked
sg.Pepper
Second Lieutenant
Posts: 152
Joined: Tue Jan 13, 2004 2:47 pm
Location: Czrch Republic
Contact:

targetname of bomb

Post by sg.Pepper »

HI, I HAVE A QUSTION:
i create an obj MP map with 5 bombs (targetname $bomb1....5).
And i want to know a targetname of bomb, which was just planted or defused, for better orientation of players.
Can somebody help?
thanks
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

If you are useing the obj_dm.scr then you set the trigger_name key on the bomb to the targetname of the trigger to tell the script what trigger controls the bomb right ?.
bomb_waittill_set:

self model items/pulse_explosive.tik

while ( $(self.trigger_name) )
{
println "waittill trigger " self.trigger_name
self.trigger_name waittill trigger

local.player = parm.other
//"local.player.dmteam", can be 'spectator', 'freeforall', 'allies' or 'axis'
if (local.player.dmteam != level.planting_team)
{
goto bomb_waittill_set
println "failed dmteam check" local.player.dmteam
}
You can just edit the obj_dm.scr in these threads or maybe use a setthread value on the trigger
if (local.counter >= level.bomb_set_time)
{
iprintlnbold "A Bomb has been planted!"
if (level.planting_team == "allies")
self playsound dfr_objective_o
else
self playsound den_objective_o
thread bomb_waittill_defuse
thread bomb_waittill_explode
self.live = 1
level.bombs_planted ++
end
}
wait .1
if (local.counter >= level.bomb_defuse_time)
{
iprintlnbold "A Bomb has been defused!"
if (level.defusing_team == "allies")
self playsound dfr_diffused_d
else
self playsound den_diffused_d
thread bomb_waittill_set //start first thread again
self.live = 0
level.bombs_planted --
end
}
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Ooh looks like a double-post... please concentrate the discussion in this thread:

/forum/viewtopic.php?t=9789

:wink:
Image
Locked