2 objectives


(Paul) #1

Hi guys,

how you can do that if you have 2 objectives (both maps that need to be taken) that if you have 2 of them the round stops

Greets me again:wink:


(th0rn3) #2

Your map actualy are team_ctf_redflag or team_ctf_blueflag with model set (i dont remember actual names coz’ its 2am and im on my mobile, not pc). If its a redflag only allies can capture it and vice versa. As you said, you want 2 maps to be stolen, so type a key: count and a value: 2. DO NOT set a targetname or a scriptname. Maps are done!
From here everyting depends on what you wanna do: if you want it to droped off at the red model (ex: if a truck does not have a gold in it you see red contours of that gold crate) (in most cases you want this, so you need a red contoured model of your map(trick: if you dont have a contoured version or you are just lazy to create one, just write this at your script: setstate your_map underconstruction)).
Ok, lets say you want a ā€œred dropoffā€.
Add a contoured model at your drop off point and enter your scriptname and targetname (i will use a tragetname of map1_red and map2_red here). Add a normal version of your model, exactly where the contoured ver is, and enter your scriptname and target name (i will use map1 and map2 here). Same with 2nd map.
Add a trigger_flagonly_multiple around your dropoff point, then set the same scriptname as you set for models (NOTE: you must have only 1 TFM). There are somespawn flags in the TFM whitch will you figure out yourself.
If you want a ā€œYou are nearā€¦ā€ message add a TOI around your dropoff point, and if you want a command map icon, target that TOI to a misc_commandmap_marker.
We have done a dropoff point.
Time to script!

game_manager
{
   globalaccum 7 set 0
   setstate map1 invisible
   setstate map2 invisible
}
maps
{
   death
   {
      globalaccum 7 inc 1
      trigger self check
   }
   trigger check
   {
      globalaccum 7 trigger_if_equal 1 self first_map
      globalaccum 7 trigger_if_equal 2 self win
   }
   trigger first_map
   {
      setstate map1_red invisible
      setstate map1 default
   }
   trigger win
   {
      setstate map2_red invisible
      setstate map2 default
      wm_setwinner 1
      wait 2000
      wm_endround
   }
}

DONE!
I hope you are not a total n00b and will understand things.
Did that helped? I would like to be credited on the loading screen or readme. My et name is ^1.:: ^2OHG ^1::. ^2Th^30^2rn^33
greetz


(stealth6) #3

Dude you seriously need to find something better to do with your time :stuck_out_tongue:


(-SSF-Sage) #4

Your game_manager isn’t right. :wink: Also not worth wasting a globalacccum cos accum will do it just fine.

Also I find it handy to have the spawn stuff in the specific scriptblock where it is used, instead of bugging out the spawn of the game_manager, but both will do it just fine.

Btw. I’ve never used death event on the flagonly. I usually have all scripting done from the flag itself, then I can have, returned, captured, dropped etc. triggers. And I have the checkgame trigger in the game_manager, which incs and checks and then ends round, if I have dual obj. like this… I suggest that method, if the flags has to be in different places.

But here is a fix, for this method:


maps
{
   spawn
   {
   wait 100
   accum 0 set 0 //why not have it accum 0 instead, looks better ;)
   setstate map1 invisible
   setstate map2 invisible
   }
   death
   {
      accum 0 inc 1
      trigger self check
   }
   trigger check
   {
      accum 0 trigger_if_equal 1 self first_map
      accum 0 trigger_if_equal 2 self win
   }
   trigger first_map
   {
      setstate map1_red invisible
      setstate map1 default
   }
   trigger win
   {
      setstate map2_red invisible
      setstate map2 default
      wm_setwinner 1
      wait 2000
      wm_endround
   }
}



(th0rn3) #5

Oh thx for fix.

I go to sleep late. Also helping people is my destiny. I can help in all aspects of PC. I also help my IT teacher in school. Its also easter holiday, so as said in the song lemon tree:

[quote]Im wasting my time,
I have nothing to do,
Im hanging around,
etc etc etc[quote]


(Paul) #6

I doestn’t work; does anyone have a tutorial or something>?


(-SSF-Sage) #7

Provide us info? What happens? Oh yeah and it should work, I didn’t notice more typos there. Have you set your script properly? Have the game_manager too? Script_multiplayer with scriptname game_manager in your map? Script file really .script file? Is it in your maps folder named as mymapsname.script? Etc etc.

Th0rn3: No problem, shit happens. I do a lot of typos what so ever, but I usually read my posts 5 times after I send it. Which leads to that I edit my posts atleast 5 times. :cool: