Ctf-Face (UT2000 remake)


(==Troy==) #21

Yeah… Could someone please help me with the script file for the map?

I have no idea about the syntax of the scripts in ET, and this was taken from Loffy’s topic “ctf-prefab 2”.



game_manager
{
   spawn
   {
      wait 500         
      wm_set_round_timelimit   20   
      wm_axis_respawntime    15
      wm_allied_respawntime   15
      wm_setwinner 0

      alertentity allied_flag   // reveal the flags to start with, setstate invisble and default
      alertentity axis_flag   // should work from here on.

      accum 1 set 0      // allies flag captured counter.
      accum 2 set 0      // axis flag captured counter.
   }

   trigger allies_captd      // update allies captured, just 4 flags for this test
   {
      accum 2 inc 1
      accum 2 trigger_if_equal 4 game_manager allies_win
   }

   trigger axis_captd      // update axis captured, just 4 flags for this test
   {
      accum 1 inc 1
      accum 1 trigger_if_equal 4 game_manager axis_win
   }

   trigger allies_win
   {
      wm_announce "Allies have Captured all 4 Flags!!!!"
      wm_setwinner 1   // allies win.
      wm_endround      // end game.
   }

   trigger axis_win
   {
      wm_announce "Axis have Captured all 4 Flags!!!!"
      wm_setwinner 0   // axis win.
      wm_endround      // end game.
   }

   trigger timelimit_hit   // who has more captures or if they broke even
   {
      wm_setwinner -1
      trigger game_manager parse_allies
      trigger game_manager parse_axis
      wm_announce "Both teams have Tied!!"
      wait 250
   }
}

//
// flag control as per madmaximus script...
//
allied_flag
{
   trigger stolen   // axis stole a flag
   {
      setstate allied_flag invisible      // hide the team_CTF_blueflag entity
      setstate allies_cap_flag invisible      // hide the allies trigger_flagonly_multiple in case the allies
   }                        // have the axis flag, they can't cap it.

   trigger returned   // flag was dropped and timed out or an allied player touched it
   {
      setstate allied_flag default         // axis lost the flag, so setstate the team_CTF_blueflag and
      setstate allies_cap_flag default      // their trigger_flagonly_multiple back.
   }
}

axis_flag
{
   trigger stolen   
   {
      setstate axis_flag invisible
      setstate axis_cap_flag invisible
   }

   trigger returned
   {
      setstate axis_flag default
      setstate axis_cap_flag default
   }
}

allies_cap_flag   // allies have transported the axis flag and made it back to their flagpole.

{
   death
   {
      setstate axis_flag default      //  flag comes back minus 1 count,
      setstate axis_cap_flag default   // trigger_flagonly_multiple back also.
      wm_announce "the Allies have Captured the Flag!!!"
         trigger game_manager allies_captd  // go update the allies flag captured counter.
   }
}

axis_cap_flag

{
   death
   {
      setstate allied_flag default
      setstate allies_cap_flag default
      wm_announce "the Axis have Captured the Flag!!!"
      trigger game_manager axis_captd
   }
}

I do not know how to do parse_allies/axis part, where it has to compare 2 accum values and judge the winner.

Could you also please include the sound for flag dropped/captured? As it works only for flag returned and taken.

Could you also please include an announcement of the score after each capture, the score not in event (console) but in announcement in the middle bottom of the screen :slight_smile:

Thank you very much! The script file is the only thing which is holding me from releasing fp1 :slight_smile:


(murka) #22

hmm i would like to help but my brain has stopped responding, only thing i can tell right now is that you can only make announcements to the middle left of your screen(or somewhere else depending on the hud placement, but you might have the announcement bar in there where you said)


(ailmanki) #23

afaik where wm_announce is displayed depends on the mod and its settings

accum uses a local variabl which is only valid in the function scope

so where the function is triggered that a flag has been captured

you find this line:
trigger game_manager allies_captd // go update the allies flag captured counter.

this line does execute:
trigger allies_captd // update allies captured, just 4 flags for this test
{
accum 2 inc 1
accum 2 trigger_if_equal 4 game_manager allies_win
}

what happens here?
accum 2 inc 1
does increment the 2. variabl by 1

accum 2 trigger_if_equal 4 game_manager allies_win
does trigger game_manager allies_win if the variabl 2 has the value 4.

I hope that helps a bit


(Flippy) #24

Why not use RayBan’s script to show the score next to the compass?
Works great, you only need remap a shader (via the script). No mods or things like that needed.
You should be able to find it searching for Compass scoreboard with author rayban.

If you need help with your CTF script I might be able to help you. Been a long time since i did ET scripting but might come back to me in a few minutes :stuck_out_tongue:

I made a CoD style Search and Destroy gametype, CTF, UT2004 Double Domination, and was working on UT2004 Onslaught but quit it due to time restraints and not playing ET much anymore…

Do you have MSN? You can add me if you have:
r0fnick [at] gmail [dot] com


(==Troy==) #25

is it possible to do a

trigger parse_allies
{
accum 2 trigger_if_greater accum 1 game_manager allies_win
}

? :slight_smile:

I also have looked at radar map script and didnt find a script for “dropped” announcement, or maybe it was another map :?


(Loffy) #26

Hi

In your game_manager script above, accum 1 is the allies flag captured counter. In trigger allies_captd accum 2 is increased by 1 and not accum 1. Should it not be accum 1 in trigger allies_captd?

In your script, you also have a section called allied_flag. I am not sure what entity this part is for. Is it the blue Allied flag in the allied base, or is it the red allies target flag (the one in the Axis base)?

You asked if it is possible to have just one flag entity for each team. Instead of multiple flag entities, like I usually have. Yes, this is possible. When the allies steal the red flag, the red flag entity is hidden via scripting. Just like you yourself suggest. Take a look at the ET custom CTF map GreyHour (by Lang), which has this feature:
http://langstas.com/maps/lp2_ctf.pk3

Lastly, these are the parts I use when I script for a flag (see below):


flag
{
  spawn
  {
    wait 200
  }

  trigger stolen
  {
    //script
  }

  trigger returned
  {
    // Script
  }

  trigger captured
  {
    // Script
  }
}

You can toss in custom voices at each part if you want. How to add voices to maps is described in this recent thread by Flippy:
http://www.splashdamage.com/forums/viewtopic.php?t=16780

Keep on mapping
//Loffy


(==Troy==) #27

No, I have 2 flags in total, 1 per team. It doesnt matter whether accum 1 or 2 for allies or axis flag, I just need the cmd, which will compare accum 1 value with accum 2 value :slight_smile:

Thank you :slight_smile:


(Flippy) #28

Unfortunately, you cannot use logic such as “If accum 2 > accum 1”.
(Or as you were trying “Accum 2 trigger_if_equal accum 1 …” Which is essentially the same.

there are other ways to do it though.
If you want to run a script when Accum 2 > Accum 1 for example, you will need to use multiple script pieces.
For example:


trigger accum_compare
{
//Check what accum 2 is
   accum 2 trigger_if_equal 0 game_manager tr_accum2_0
   accum 2 trigger_if_equal 1 game_manager tr_accum2_1
}

trigger tr_accum2_0
{
   //Accum 2 = 0, check what accum 1 is
   accum 1 trigger_if_equal 0 game_manager tr_accum2_0_accum1_0
   accum 1 trigger_if_equal 1 game_manager tr_accum2_0_accum1_1
}

trigger tr_accum2_1
{
//Accum 2 = 1, check waht accum 1 is
   accum 1 trigger_if_equal 0 game_manager tr_accum2_1_accum1_0
   accum 1 trigger_if_equal 1 game_manager tr_accum2_1_accum1_1
}

trigger tr_accum2_0_accum1_0
{
//Do things if accum2 = 0 and accum 1 = 0
}
trigger tr_accum2_1_accum1_0
{
//Do things if accum2 = 1 and accum1 = 0
}
trigger tr_accum2_0_accum_1_1
{
//Do things if accum 2 = 0 and accum 1 = 1
}
trigger tr_accum2_1_accum_1_1
{
//Do things if accum 2 = 1 and accum 1 = 1
}

Yeah, ET scripting sucks, i know :stuck_out_tongue:
A simple “If … Then…” would have worked alot better…
This example is only with 2 values for 2 accums… you can imagine how much it would be for alot more values / accums…

However, I cant remember if i used this in a CTF script… i dont think so…
I will search through my old files, see if i can find my CTF prefab with working UT-style CTF + voices + rayban’s compass scoreboard… i dont think i still have it though :frowning:


(==Troy==) #29

Thats bad news then :frowning: Because the Rayban’s compass file in no longer avialable. And also his script produces an error? As I understood from the thread.

Hmm… Iv got an idea for the accum comparasent. We know that they are both smaller or equal to 4 (I hope that you can do the proper “if” cycles! otherwise I will be hating scripting language in ET)

a1 = accum 1
a2 = accum 2


compare (a1 a2);
{
    if a1 != 4;
   {
      if a2 != 4;
       {
          a1 +1;
          a2 +1;
          compare;
       }
     axis_win;
    }
    if a2 == 4;
    {
       tie;
    }
  allies_win;
}  

But this is the worst way of doing this, and this is assuming that you can use recurssion in ET…


(Flippy) #30

Rayban’s script did produce an error, but only if you have more than 7 or 8 scores to keep up with (eg 0 to 7 for allies and 0 to 7 for axis). That would simply be too much code for the game to handle.
It works fine with a 3-score CTF though.

About the script idea you had, forget it :wink:
It’s totally impossible in ET to script like that… is it C? or C++ or… dunno (only know visual basic).
You need to use the game’s map scripting engine, which sucks :wink:
But it is possible :wink:

Oh also, there is also a “trigger dropped” for a returnable objective, along with stolen, returned and captured.

I still got the scoreboard pk3, uploaded it here:
http://rapidshare.com/files/30566753/ctf_scoreboard1.pk3.html

You might need to edit it… i think it goes to 8 by default and you need only 3 or 4…

If you add me on MSN i might have some free time to help you with the CTF script and possibly also with the scoreboard :slight_smile: It’s not that hard actually…


(==Troy==) #31

I have added you to MSN already… :?

Ill send authorization request once more :slight_smile:


(Flippy) #32

Ok i worked on your map for a short while, and i got the CTF scripts working flawlessly now.

I included RayBan’s scoreboard too, and included the scriptlines needed for voiceovers, although i commented them out because we still need the voiceover files :stuck_out_tongue:

Also added stars, by simply changing the “Black.jpg” textrue to a black texture with stars! Looks realistic to me, apart from some stretching maybe…
Ill send you the updated files when I see you online.


(==Troy==) #33

Yup… Stars… Got one thing to try. Probably will work


(RayBan) #34

i have an 8 flag ctf sample map with new flag models as well as a different
style scoreboard displayed under the health/stamina bars

its uses a small script using just one ctf entity for each team

sample map/bsp/script/models and the scores included if you want to
use anything as a reference or whatever.

file here at rapidshare
http://rapidshare.com/files/31018323/8flag_ctf_sample.pk3.html


(==Troy==) #35

Thank you RayBan, but your compass scoreboard worked perfectly for 3 flags ctf :slight_smile:


(==Troy==) #36

=====THE MAP IS RELEASED=====

Download link: http://www.thexclamation.com/troy/ctf-face-fp1.pk3

Authors : ==Troy== & Flippy.

Description: A map based on classic map from UT2000, featuring CTF (Capture the flag) gametype (max - 4 flags).

Time of the map: 20 min. Or until one of the teams reaches 4 flags. Tie situation possible.

N. of spawns : 32 per team. 16 per side of the tower (2 sides).

I would be greatfull if someone will explain how to upload map to et.splatterladder.com :). Thank you. Any comments and suggestions are welcome. But bear in mind that this is a classics and the map layout will not be altered (in a large amounts).

Huge thanks to Rayban and his compass scoreboard :slight_smile:

And Please Bear in mind, this is first playable version.


(broloi) #37

first of all, do always put it in a zip file, since some noob might just exstract it…

secondly, ill take a look and edit my post ^^


(murka) #38

dlling…


(==Troy==) #39

omfg… zip file? Need to fix it fast ^^

Wait, it is pk3, not zip


(broloi) #40

first thing is GRAVITY… i know you’ve talked a lot about making a mod that change the gravity and all… but still, as for now, could you put, just a little gravity on?

then, the portals, if you look behind them… You can just look thru 'em, from behind.

And lastly, that little box the spectators start in, its visible from the axis tower.