Changing / removing map icon of TWOs


(hummer) #1

Before I saw “setautospawn” I set up my spawns Everything does work (I set them up a funky way, as decribed below), but something annoys me.

Okay, right now, I have 3 sets of spawns per team (6 in all). Depending on how the game progresses… the spawns change. There are no forward spawn flags, the spawns simply shift as the game goes on.

So, I have 5 TWO (team_wolf_objectives) in all. They all display a flag on the command map. However, I want those flags to either… disappear or change at certain points… that’s what annoys me. Too many flags on the screen at once, and I want to be able to change / remove the icon…

Is this possible? I haven’t been able to remove / change the icon on the command map for a TWO.

Also, one person I know has a problem with the TWO icon not showing up at all for a neutral forward spawn. How can they get the icon to show up? He wants it to change depending on what team grabs it… but the icon is invisible on the command map.

If only there was some way to trade problems… :slight_smile:


(Moonkey) #2

I did some investigating about this not long ago.

Check out the script for the side bunker on radar. Its a compost rather than a flag, but same deal.
Also, if you want the TWO to disappear from the beginning of the map, the wait 50 before making it invisible is important.


(Mean Mr. Mustard) #3

To get a command map flag to show up for a forward spawn, you need to use an ‘alertentity xxxx’ where xxx is the scriptname of the TWO when it is activated /captured.

I have an idea fo your case hummer but need to do some testing first - don’t want to look like an idiot :smiley:


(Moonkey) #4

That will switch it between showing as allied or axis on the command map, but wont make it show up if it isn’t already there.

BTW, you always need to set either the axis or allied checkbox to get it to show up at all.


(Mean Mr. Mustard) #5

hummer - yes, it is possible to do that (and not too hard)

I have a question on how you have your TWO’s set up. Since you have 5 TWO’s, I assume you have one for the initial allied spawn, one for the final axis spawn, and the other 3 are the ‘flip/flop’ spawns when an objective is met. Is this the case? Also, do you want the spawn locations to be removed completely from the map (ie. can’t use them again ever?)

Most of it is taken care of through scripting. I’ll set up a little map and post it once I have your replies.


(Ifurita) #6

Is this really true? In Railgun, the depot flag is neutral until taken by someone. I have the same situation where i have a neutral flag and everything works as expected, except that it doesn’t show up for the owning team


(G0-Gerbil) #7

setstate-ing works for me?


(hummer) #8

Yeah… basically…

There are 5 TWOs… and 6 sets of spawns, so one TWO is used for an axis spawn, then later, an allied spawn.

There are three stages of spawns:

Stage 1: Allies at TWO 1, Axis at TWO 2.
Stage 2: Allies at TWO 3, Axis at TWO 4.
Stage 3. Allies at TWO 2, Axis at TWO 5.

Notice TWO 2 is used for an axis spawn at the beginning, then an allied spawn at the end. That make much sense?

In any event, I’d like the flag to display when the team is spawning there, and not display when the team is not spawning there. Is it as simple as setting the TWO to invisible / default in the script? Crap, I just realized I didn’t try that.


(hummer) #9

Yeah, didn’t even cross my mind for some reason. I bet that will work, and when it does, you’ll get much <3.


(Mean Mr. Mustard) #10

For hummer’s case: It’s the setstate-ing of the TWO that gets it to show/remove from the command map - at least that works for me. Of course I had my TWO and team_CTF_bluespawn with the same scriptname and targetname (ie: each were alliedspawn). Then the setsate didn’t do anything. Once I gave the TWO a unique scriptname and targetname, then I could get it on/off the command map.


(hummer) #11

[quote=“Ifurita”]

Is this really true? In Railgun, the depot flag is neutral until taken by someone. I have the same situation where i have a neutral flag and everything works as expected, except that it doesn’t show up for the owning team[/quote]

When neither spawnflag is set, it defaults to an allied flag.

Is there a way to change it to a neutral / gray flag through state setting?


(Mean Mr. Mustard) #12

I have a stupid little map that sort of does what hummer wants (not as complicated - but it switches the spawn points and cm flags)

Excuse the very poor brush work (it’s the first test map I did - and I usually test new things in it)

http://www.cobaltcfd.com/et/mustard/

File is called spawn_move.zip and includes the .map and .script file

If you get prompted for a username/password, just ignore it and hit cancel


(Mean Mr. Mustard) #13

For a forward/capture spawn point, I need to ‘alertentity front_TWO’ or whatever it’s called to get the flags to show up correctly on the command map. But, it only works if one team has the flg initially.

It’s in my little test map. If I comment ot ‘alertentity front_spawn_TWO’ then the cm doesn’t swtich for either team


(G0-Gerbil) #14

One way would be to have a TOI and a misc_commandmapmarker (or whatever it’s called) with a neutral flag image specified.
Then the flag itself shows none, until it’s captured, then you show that as well as hide the neutral one by setstating the TOI and CMM.


(hummer) #15

Pwnt! Thanks everyone. Spawns are working now. State setting did the trick.


(Ifurita) #16

w00t, mine works now too.


(G0-Gerbil) #17

\o/


(Ifurita) #18

damn, a new problem.

It was working, now it doesn’t and I have no idea what I changed. Basically, my forward flag works as expected, except that when an axis player grabs the flag, the axis flag runs up the flag pole, BUT the allied flag pops up on the allied players CM. When an allied player retakes the flag, the allied flag runs up the flagpole BUT the flag on the allied CM disappears and now the axis players see an axis flag on their CM.

Here is the script I am using - pretty vanilla

/beats head against wall.


//Forward Spawn Point
forward_spawn
{
	spawn
	{
		wait 200
		setstate mosque_wobj invisible
		accum 0 set 2	// Who has the flag: 0-Axis, 1-Allied, 2-nobody
	}

	trigger axis_capture	// Flag has been touched by an Axis player
	{
		accum 0 abort_if_equal 0 // do Axis own flag?

		accum 0 set 0 // Axis own the pole
		wm_announce	"Axis reclaim the Mosque Courtyard!"

		wm_objective_status 		7 0 1
		wm_objective_status 		7 1 2

		setstate mosque_wobj default
		alertentity mosque_wobj
	}

	trigger allied_capture	// Flag has been touched by an allied player
	{
		accum 0 abort_if_equal 1 // do Allies own flag?

		accum 0 set 1 // Allied own the flag
		wm_announce	"Allies capture the Mosque Courtyard!"

		wm_objective_status 		7 0 2
		wm_objective_status 		7 1 1

		setstate mosque_wobj default
		alertentity mosque_wobj
	}
}

(Erik-Ftn) #19

I did this to make a neutral spawnpoint:

The TWO is invisible (setstate) and axis from start ->

each time its captured it’s toggled who has it, objective status, and autospawns ->

if axis capture it first it must be toggled an extra time just that time to get it right.

I guess just targeting the spawnpoints with the checkpoint takes care of which one of those get’s triggered and not, I had both OFF on spawn and it works nicely…
->
I don’t need to keep track of who has the flag or spawns with accums since I use a checkpoint and don’t need to know for other purposes.

checkpoint2
{

 spawn
 {
  accum 1 set 0  // first time flag yes
  accum 2 set 0  // toggle extra time flag set to no  
 }

 trigger allied_capture 
 {
  accum 1 trigger_if_equal 0 cornerblob lightflag  // light flag

  trigger game_manager obj7allied
  setautospawn "axisstart" 0
  setautospawn "corner" 1
  alertentity cornerblob   // toggle flag
  accum 1 set 1   // first time set to no
  accum 2 set 0   // toggle extra time flag set to no  
 }

trigger axis_capture 
 {
  accum 1 trigger_if_equal 0 cornerblob lightflag // light flag 

  trigger game_manager obj7axis
  setautospawn "alliedstart" 1
  setautospawn "corner" 0
  alertentity cornerblob  // toggle flag 
  accum 1 set 1 // first time set to no
 
  accum 2 abort_if_equal 0 // axis extra first time toggle ?
  alertentity cornerblob   // toggle extra time
  accum 2 set 0            // toggle extra time flag set to no
 }

 trigger var_flag 
 {
  accum 2 set 1  // toggle extra time flag set to yes 
 }

}


cornerblob
{
 spawn
 {
  setstate cornerblob invisible
 }

 trigger lightflag
 {
  setstate cornerblob default   // light flag
  trigger checkpoint2 var_flag  // call to set extra toggle flag 
 }
}

…well I have since made a more elegant solution, you don’t really need to have the lightflag trigger in the cornerblob routine…

but lolololololol this one works and the elegant one does not…

cheers

Erik


(Moonkey) #20

The obvious problem would be that the spawnflags on the TWO have gotten messed up, but other than that it must be an extra “alertentity mosque_wobj” somewhere in your script. (or it’s targetted by something which triggers it directly in the .map?)