Problems with triggers
Moderator: Moderators
Problems with triggers
Hi again !
I have a few problems with my map, I added a minefield, random explodes and damaging flames to my map. Now when I am trying to load the map it`s sending me back to the briefing room. Console says : Developer, your script is broken. I just can`t figure out what is wrong ?
Here is my script:
// talvisota
// ARCHITECTURE: Carnivora
// SCRIPTING: Carnivora
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Talvisota"
setcvar "g_obj_alliedtext2" "By Carnivora"
setcvar "g_obj_alliedtext3" "(TeurasCompany)"
setcvar "g_obj_axistext1" "Talvisota"
setcvar "g_obj_axistext2" "By Carnivora"
setcvar "g_obj_axistext3" "(TeurasCompany)"
setcvar "g_scoreboardpic" "talvisota"
//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
exec global/minefield.scr
level.script = maps/dm/talvisota.scr
//exec global/ambient.scr mohdm2
//$world farplane 5000
//$world farplane_color (.333 .333 .329)
level waittill spawn
//hurt script by blue60007
my_hurt_trigger:
$my_hurt_trigger volumedamage 100 //hurts the player
end
thread random_explode1
end
random explode_1:
wait (randomfloat 13+23)
$random_explode anim start
radiusdamage $random_explode 256 384
goto random_explode1
end
//-----------------------------------------------------------------------------
roundbasedthread:
// TeurasCompany
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 have a few problems with my map, I added a minefield, random explodes and damaging flames to my map. Now when I am trying to load the map it`s sending me back to the briefing room. Console says : Developer, your script is broken. I just can`t figure out what is wrong ?
Here is my script:
// talvisota
// ARCHITECTURE: Carnivora
// SCRIPTING: Carnivora
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Talvisota"
setcvar "g_obj_alliedtext2" "By Carnivora"
setcvar "g_obj_alliedtext3" "(TeurasCompany)"
setcvar "g_obj_axistext1" "Talvisota"
setcvar "g_obj_axistext2" "By Carnivora"
setcvar "g_obj_axistext3" "(TeurasCompany)"
setcvar "g_scoreboardpic" "talvisota"
//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
exec global/minefield.scr
level.script = maps/dm/talvisota.scr
//exec global/ambient.scr mohdm2
//$world farplane 5000
//$world farplane_color (.333 .333 .329)
level waittill spawn
//hurt script by blue60007
my_hurt_trigger:
$my_hurt_trigger volumedamage 100 //hurts the player
end
thread random_explode1
end
random explode_1:
wait (randomfloat 13+23)
$random_explode anim start
radiusdamage $random_explode 256 384
goto random_explode1
end
//-----------------------------------------------------------------------------
roundbasedthread:
// TeurasCompany
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
As JV said
also you need an end just below these lines;
level waittill spawn
//hurt script by blue60007
end //this marks the end of the main method here
also....
random_explode_1: // <------ you had a space in the label.
while (1)
{
wait ((randomfloat 13) +23)
$random_explode anim start
radiusdamage $random_explode 256 384
}
//goto random_explode1 ---JV dont like goto's
this looks nicer now
end
also...
remove the end from the middle of the thread that calls the random_explode_1 thread......
and.......
thread random_explode1 //this dosnt match the thread label you had below. Easy to do, I have done it myself when using complicated label names, the best thing to do is use copy and paste if label names are long and complex, it elimenates the chance of typos sneaking in..
level waittill spawn
//hurt script by blue60007
end //this marks the end of the main method here
also....
random_explode_1: // <------ you had a space in the label.
while (1)
{
wait ((randomfloat 13) +23)
$random_explode anim start
radiusdamage $random_explode 256 384
}
//goto random_explode1 ---JV dont like goto's
end
also...
remove the end from the middle of the thread that calls the random_explode_1 thread......
and.......
thread random_explode1 //this dosnt match the thread label you had below. Easy to do, I have done it myself when using complicated label names, the best thing to do is use copy and paste if label names are long and complex, it elimenates the chance of typos sneaking in..
Sorry for writing this in to mapping, should have written it in to scripting.
The flame is working fine but the explosions arent`t. Every time I enter the minefield I hear "a clikc", but nothing happens. The "mines" won`t explode.
So there is still something wrong ?
Thx for quick reply
// talvisota
// ARCHITECTURE: Carnivora
// SCRIPTING: Carnivora
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Talvisota"
setcvar "g_obj_alliedtext2" "By Carnivora"
setcvar "g_obj_alliedtext3" "(TeurasCompany)"
setcvar "g_obj_axistext1" "Talvisota"
setcvar "g_obj_axistext2" "By Carnivora"
setcvar "g_obj_axistext3" "(TeurasCompany)"
setcvar "g_scoreboardpic" "talvisota"
//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
exec global/minefield.scr
level.script = maps/dm/talvisota.scr
//exec global/ambient.scr mohdm2
//$world farplane 5000
//$world farplane_color (.333 .333 .329)
level waittill spawn
//hurt script by blue60007
end//
my_hurt_trigger:
$my_hurt_trigger volumedamage 20 //hurts the player
end
random_explode_1://
{
wait ((randomfloat 13)+23)
$random_explode anim start
radiusdamage $random_explode 256 384
}
//goto random_explode1
end
//-----------------------------------------------------------------------------
roundbasedthread:
// TeurasCompany
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
The flame is working fine but the explosions arent`t. Every time I enter the minefield I hear "a clikc", but nothing happens. The "mines" won`t explode.
So there is still something wrong ?
// talvisota
// ARCHITECTURE: Carnivora
// SCRIPTING: Carnivora
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Talvisota"
setcvar "g_obj_alliedtext2" "By Carnivora"
setcvar "g_obj_alliedtext3" "(TeurasCompany)"
setcvar "g_obj_axistext1" "Talvisota"
setcvar "g_obj_axistext2" "By Carnivora"
setcvar "g_obj_axistext3" "(TeurasCompany)"
setcvar "g_scoreboardpic" "talvisota"
//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
exec global/minefield.scr
level.script = maps/dm/talvisota.scr
//exec global/ambient.scr mohdm2
//$world farplane 5000
//$world farplane_color (.333 .333 .329)
level waittill spawn
//hurt script by blue60007
end//
my_hurt_trigger:
$my_hurt_trigger volumedamage 20 //hurts the player
end
random_explode_1://
{
wait ((randomfloat 13)+23)
$random_explode anim start
radiusdamage $random_explode 256 384
}
//goto random_explode1
end
//-----------------------------------------------------------------------------
roundbasedthread:
// TeurasCompany
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
script
This script should work. Is there a "setthread" in the map that runs the my_hurt_trigger thread?
//-----------------------------------------------------------------------------
// talvisota
// ARCHITECTURE: Carnivora
// SCRIPTING: Carnivora
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Talvisota"
setcvar "g_obj_alliedtext2" "By Carnivora"
setcvar "g_obj_alliedtext3" "(TeurasCompany)"
setcvar "g_obj_axistext1" "Talvisota"
setcvar "g_obj_axistext2" "By Carnivora"
setcvar "g_obj_axistext3" "(TeurasCompany)"
setcvar "g_scoreboardpic" "talvisota" // requires an image and shader file to work
// next two lines call additional stuff if the game is round based
if(level.roundbased)
thread roundbasedthread
level waitTill prespawn
//*** Precache Dm Stuff
exec global/DMprecache.scr
thread global/minefield.scr::minefield_setup
level.script = maps/dm/talvisota.scr
//exec global/ambient.scr mohdm2 // adds background sound (not turned on)
//$world farplane 5000 // fog distance (not turned on)
//$world farplane_color (.333 .333 .329) // fog color (gray) (not turned on)
level waittill spawn
thread random_explode_1 // this line executes the thread named
end
//-------------------------------->
// Round based Thread
//-------------------------------->
roundbasedthread:
// Can specify different scoreboard messages here--
// otherwise it will use the ones up top.
level waittill prespawn
level waittill spawn
// set the parameters for a 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
//-------------------------------->
// New Threads
//-------------------------------->
my_hurt_trigger:
wait .2
$my_hurt_trigger volumedamage 20 //hurts the player
end
random_explode_1:
wait (randomfloat 13 + 23) // this line is right out of obj_team3 and is correct
$random_explode playsound arty_leadinmp
wait 1
$random_explode anim start
radiusdamage $random_explode 256 384
goto random_explode_1 // this line makes the thread loop
end
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// talvisota
// ARCHITECTURE: Carnivora
// SCRIPTING: Carnivora
main:
// set scoreboard messages
setcvar "g_obj_alliedtext1" "Talvisota"
setcvar "g_obj_alliedtext2" "By Carnivora"
setcvar "g_obj_alliedtext3" "(TeurasCompany)"
setcvar "g_obj_axistext1" "Talvisota"
setcvar "g_obj_axistext2" "By Carnivora"
setcvar "g_obj_axistext3" "(TeurasCompany)"
setcvar "g_scoreboardpic" "talvisota" // requires an image and shader file to work
// next two lines call additional stuff if the game is round based
if(level.roundbased)
thread roundbasedthread
level waitTill prespawn
//*** Precache Dm Stuff
exec global/DMprecache.scr
thread global/minefield.scr::minefield_setup
level.script = maps/dm/talvisota.scr
//exec global/ambient.scr mohdm2 // adds background sound (not turned on)
//$world farplane 5000 // fog distance (not turned on)
//$world farplane_color (.333 .333 .329) // fog color (gray) (not turned on)
level waittill spawn
thread random_explode_1 // this line executes the thread named
end
//-------------------------------->
// Round based Thread
//-------------------------------->
roundbasedthread:
// Can specify different scoreboard messages here--
// otherwise it will use the ones up top.
level waittill prespawn
level waittill spawn
// set the parameters for a 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
//-------------------------------->
// New Threads
//-------------------------------->
my_hurt_trigger:
wait .2
$my_hurt_trigger volumedamage 20 //hurts the player
end
random_explode_1:
wait (randomfloat 13 + 23) // this line is right out of obj_team3 and is correct
$random_explode playsound arty_leadinmp
wait 1
$random_explode anim start
radiusdamage $random_explode 256 384
goto random_explode_1 // this line makes the thread loop
end
//-----------------------------------------------------------------------------
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
Hi,
First little backroun for my mapping, this is the first map I`m doing. So please have pation with me
Tom, I made a script exactly the way you told me to do but it didn`t work. Console says: wait.2 unknown line or something. I took it away and then all worked fine, minefield, hurttriggers and explodes. I even figured out how to add more explotions.
But now I have a new problem.
I added some my_hurt_trigger`s. One is in the flames, and first it worked fine. But then I added 2 trigger`s in to 2 different barbwires and now none of the trigger`s works. I tryed to name them as:
my_hurt_trigger_1
$my_hurt_trigger volumedamage 20 //hurts the player
my_hurt_trigger_2
$my_hurt_trigger volumedamage 5 //hurts the player
my_hurt_trigger_3
$my_hurt_trigger volumedamage 5 //hurts the player
Have I named them wrong ?
THX to all who helped me with these questions.
And Green Beret, I like the "click" but players don`t
First little backroun for my mapping, this is the first map I`m doing. So please have pation with me
Tom, I made a script exactly the way you told me to do but it didn`t work. Console says: wait.2 unknown line or something. I took it away and then all worked fine, minefield, hurttriggers and explodes. I even figured out how to add more explotions.
But now I have a new problem.
I added some my_hurt_trigger`s. One is in the flames, and first it worked fine. But then I added 2 trigger`s in to 2 different barbwires and now none of the trigger`s works. I tryed to name them as:
my_hurt_trigger_1
$my_hurt_trigger volumedamage 20 //hurts the player
my_hurt_trigger_2
$my_hurt_trigger volumedamage 5 //hurts the player
my_hurt_trigger_3
$my_hurt_trigger volumedamage 5 //hurts the player
Have I named them wrong ?
THX to all who helped me with these questions.
And Green Beret, I like the "click" but players don`t
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
my_hurt_trigger_1
$my_hurt_trigger volumedamage 20 //hurts the player
my_hurt_trigger_2
$my_hurt_trigger volumedamage 50
//give the trigger a targetname other than the one you already used
my_hurt_trigger_3
$my_hurt_trigger volumedamage 5 //hurts the player
example below:
now name the other two triggers to match the script?
does that sound right
$my_hurt_trigger volumedamage 20 //hurts the player
my_hurt_trigger_2
$my_hurt_trigger volumedamage 50
//give the trigger a targetname other than the one you already used
my_hurt_trigger_3
$my_hurt_trigger volumedamage 5 //hurts the player
example below:
Code: Select all
my_hurt_trigger_1
$my_hurt_trigger volumedamage 20
my_hurt_trigger_2
$my_hurt_trigger2 volumedamage 20
my_hurt_trigger_3
$my_hurt_trigger3 volumedamage 20does that sound right
- Deutsche Dogge
- First Lieutenant
- Posts: 183
- Joined: Wed May 07, 2003 11:50 pm
- Location: Quebec
- Contact:
Hi, this has nothing to do with making something work that doesn't but i just thought i'd post anyway.
This thread:
Could also be coded like this:
But it's all up to you 
This thread:
Code: Select all
random_explode_1:
wait ((randomfloat 13) + 23) // this line is right out of obj_team3 and is correct
$random_explode playsound arty_leadinmp
wait 1
$random_explode anim start
radiusdamage $random_explode 256 384
goto random_explode_1 // this line makes the thread loop
end
Code: Select all
random_explode_1:
while(1) //infinite loop instead of goto 'label'
{
wait ((randomfloat 13) + 23)
$random_explode playsound arty_leadinmp
wait 1
$random_explode anim start
radiusdamage $random_explode 256 384
}
end
- Deutsche Dogge
- First Lieutenant
- Posts: 183
- Joined: Wed May 07, 2003 11:50 pm
- Location: Quebec
- Contact:
-
Green Beret
- Major General
- Posts: 746
- Joined: Mon Apr 19, 2004 12:21 pm
- Contact:
is there a list of commands and meanings,because i just pick up what i see in other scriots so far,
example
$object rotateup
i know its pretty explanatory but do yoou just try diff commands till you find one?
you know how ubersound has a list of sounds to use,is yhere a .scr or anything with useable commands?
example
$object rotateup
i know its pretty explanatory but do yoou just try diff commands till you find one?
you know how ubersound has a list of sounds to use,is yhere a .scr or anything with useable commands?




