+1 script


(Miki) #1

What i am making is a Sniper Map. (you have to shoot targets)

I want it to be Team 1 vs Team 2

so, if a target of team 1 is destroyed, i want a counter to go +1 and every 10 it announces = 10 Points, 20 points… till 50 and then the team wins…

Trough i suck at scripting, so i’ll need help. Even ETscript couldn’t help me out :twisted:


(murka) #2

thats actually easy…
do you want one shot to destroy a target giving it a point, must they move?
you can do a func_static and have it count for hits.
must test it out myself, as i havent touched radiant over 5months.


(Miki) #3

for now, the targets shouldn’t move, but every time you hint one, you get +1 point.


(murka) #4

there is a map, a TJ map, called chocojump that has moving sniper targets, you might find some useful stuff there(along with thousands of lines about name input and scores).


(DerSaidin) #5
accum 1 inc 1

Ifurita made a nice shooting range map… see if you can find it and check out its scripting.


(S14Y3R) #6

yea, for sure Der’Saidin

set all your targets up as script_movers with a health/XX key. any targetname(target_1, target_2 etc…) and give each teams targets the same scriptname, I called them moving_target_allies/axis in the example.



moving_target_allies  //with health key set, can be mobile and shootable
{
     spawn
    {
          accum 1 set 0
     }

     death
     {
          accum 1 inc 1 
          trigger script_mover score_check
     }

     trigger score_check
     {
          accum 1 trigger_if_equal 5 event_announcer_allies five_points
          accum 1 trigger_if_equal 10 event_announcer_allies ten_points
     }
}

moving_target_axis //with health key set, can be mobile and shootable
{
     spawn
    {
          accum 1 set 0
     }

     death
     {
          accum 1 inc 1 
          trigger script_mover score_check
     }

     trigger score_check
     {
          accum 1 trigger_if_equal 5 event_announcer_axis five_points
          accum 1 trigger_if_equal 10 event_announcer_axis ten_points
     }
}

event_announcer_allies //target_script_trigger/or void script_mover
{
     trigger five_points
     {
          wm_announce "5 points scored by allied team"
     }

     trigger ten_points
     {
          wm_announce "10 points scored by allied team"
     }
}

event_announcer_axis //target_script_trigger/or void script_mover
{
     trigger five_points
     {
          wm_announce "5 points scored by axis team"
     }

     trigger ten_points
     {
          wm_announce "10 points scored by axis team"
     }
}
     

I just pulled that code out of thin air, so i’m not sure if multiple script_movers with health/key still keep calling the same death{}

If not, you’ll have to customize every “targets” death to call the event_manager_XX(team) to increment accum 1 and to call the check to see if there’s enough points to merit calling the announcements…

know what I mean?

If i get a minute i’ll doublecheck if (or maybe someone knows if) different script_movers can call the same death routine as long as they all have the same scriptname, or once an entity’s dead its dead.

hmm, should w8 a couple days for some pro’s to pop in to verify what I’m thinking of.

In rememberance, gl.


(Nail) #7

iffy’s map is called tactical_final , excellent practice map