Neutral comm post controls forward spawn


(Loffy) #1

Hi!
My map has a southern, a middle and a northern part.
The axis spawn in the south and they attack. They must steal some documents in the north. To win, axis must take the stolen docs back to their escape truck in the south.
Allies spawn in the north.
There is also a spawn point in the middle. A potential forward spawn for either team.
There is a neutral command post in the middle.

This is what I want: Whoever has the command post, will have the middle spawn point (the forward spawn). How can I fix this?

It is not as easy at is might look. A neutral command post is not dichotomous, like a flag. Either team A or team B holds a flag. A neutral command post can be owned by A or B or be un-owned. If I use alertentity whenever the post is built or destroyed, the spawning will be a mess. An example: when axis builds it, first time, it is ok to use alertentity because then the spawnpoints will be toggled correctly. However, I cannot use alertentity when the allies destroy it because then allies will “get back” the forward spawn. That would be incorrect, since I wanted the forward spawn to go to the team who has built the command post.

// Loffy


(Moonkey) #2

When it is destroyed, you could use setstate to make the blob and associated spawns invisible. (will disappear from command map)
You may need to use accums to test whether to alertentity on the flag though.
ie, set an accum to 0 or 1 depending on whether axis or allies built it last. When it’s built again check if it was by the same team (dont alertentity), or the other team (do alertentity).


(Loffy) #3

Yes, I was thinking about accums yesterday evening. (I’m so tired today - at work - 'cos I sat with this until it was late.) Could I use a plain accum or should I use a globalaccum?
I had a look at the battery script to check out the globalaccums there. But I’m having a hard time understanding the difference between accums and globalaccums.


Anyhow, the idea with the setstate (default/invisible) command is a good one.
I can have four spawn points: Allied spawn, allied forward spawn, axis spawn and axis forward spawn. Then I used the setstate command to make the forward spawns active/inactive, whenever the comm. post is built/destroyed. Perhaps it will work.

Four spawn points will be like this, I guess (?):
Allied spawn, invulnerable and startactive
allied forward spawn, invulnerable
axis spawn, invulnerable and startactive
axis forward spawn, invulnerable

And the script will be something like this:

a) Game_manager spawn: allied forward spawn and axis forward spawn are setstate invisible (and their team_wolf_objectives, the “yellow blobs” as well). Also setautospawn “Axis spawn” 0, setautospawn “Allied spawn” 1. (These names Axis spawn/Allied spawn are from the Key “description” in the yellow blob.)

b) When allies build the post, the allied forward spawn and its yellow blob is setstate default and at the same time the axis forward spawn and its blob is setstate invisible. Setautospawn “Axis spawn” 0, setautospawn “Allied forward spawn” 1.

c) When allied post is destroyed, allied forward spawn and axis forward spawn are setstate invisible (and their team_wolf_objectives, the “yellow blobs”) are setstate invisible. Setautospawn “Axis spawn” 0, setautospawn “Allied spawn” 1.

d) When axis build the post, the axis forward spawn and its yellow blob is setstate default and at the same time the allied forward spawn and its blob is setstate invisible. Setautospawn “Axis forward spawn” 0, setautospawn “Allied spawn” 1.

e) When axis post is destroyed, then axis forward spawn and allied forward spawn are setstate invisible (and their team_wolf_objectives, the “yellow blobs”) are setstate invisible. Setautospawn “Axis spawn” 0, setautospawn “Allied spawn” 1.

Will this work? I’ll try it after work. Thanks for your input!
:nod:
// Loffy


(Moonkey) #4

A normal accum should work fine as long as you only use it in one entity. Just use triggers from the ‘built’ sections of your constructible entity scripts to tell the entity you choose to update the accum. (if that makes sense)

As far as the spawn points go, you should be able to just use 3.

The middle one will switch between axis and allied when you alertentity on it. The only time you will need to make it invisible is when neither team has the compost constructed. Then when it is built, setstate default, and check if it needs an alertentity to make it look right :slight_smile:


(Loffy) #5

Still at work.
What you say in this second post makes sense. I really hope it will work!
Thanks again!
// L.


(Loffy) #6

Ok, it’s 01:20 am and I think it works now.
I use three spawn areas: axis spawn in the south, allied spawn in the north and a forward spawn in the middle. The script toggles the forward spawn (see below) depending on who “owns” the command post.
The allies have the forward spawn when the game starts.

This is the game manager spawn part:
// Counter, for “who has the toggle, for forward spawn?”. (0 = axis, 1 = allies.)
globalaccum 2 set 1
setautospawn “Forward spawn” 1
setautospawn “Axis spawn” 0

This is the script, when the allies have built the neutral comm. post:
setstate forwardspawnblob default
setstate forwardspawn_axis default
setstate forwardspawn_allies default
setautospawn “Forward spawn” 1
setautospawn “Axis spawn” 0
//Checking if allies already “own” the toggle.
//If they do, then there is no reason to toggle these entities.
globalaccum 2 abort_if_equal 1
globalaccum 2 set 1
alertentity forwardspawn_allies
alertentity forwardspawn_axis
alertentity forwardspawnblob

This is when the allied comm post is destroyed:
setstate forwardspawnblob invisible
setstate forwardspawn_axis invisible
setstate forwardspawn_allies invisible
setautospawn “Allied spawn” 1
setautospawn “Axis spawn” 0

And this is when the axis have built the neutral post:
setstate forwardspawnblob default
setstate forwardspawn_axis default
setstate forwardspawn_allies default
setautospawn “Forward spawn” 0
setautospawn “Allied spawn” 1
globalaccum 2 abort_if_equal 0
globalaccum 2 set 0
alertentity forwardspawn_allies
alertentity forwardspawn_axis
alertentity forwardspawnblob

When the axis’ comm. post is destroyed:
setstate forwardspawnblob invisible
setstate forwardspawn_axis invisible
setstate forwardspawn_allies invisible
setautospawn “Allied spawn” 1
setautospawn “Axis spawn” 0

:slight_smile:
// Loffy


(Drakir) #7

Dont think you really need to make the spawns invisible.

The alertentity toggles the spawns on and off by triggering them so that should do it.


(Loffy) #8

Hi Drakir!

Remember that I must make the allied forward spawn spawnflags 3 (invulnerable and startactice). Because allies start the game with autospawn “Forward spawn”.
If the forward spawn (yellow blob and the spawn entities) were not removed (when command post is destroyed), we would have a troublesome situation. We would have a spawn area with startactive spawnentities. (A toggle is not enough, because the startactive function will not go away - just switch between bluespawn and redspawn.)

It’s true that the alertentity would toggle the spawn entities (at my forward spawn). But alterentity doesn’t make the spawn entity inactive. The spawn entities remain functional. And at any given time either blueteam or redteam would be startactive. I don’t want that. No team should be able to spawn at the forward spawn when command post is destroyed.

Anyhow, it works now. I hope. Touch wood. What remains now, is to put in some more furniture in the indoor areas to make it look better.

I wish I could do neat brush work like you have done, on your latest map Hide. Nice half-track! Did you make it? Looks cool and the MG42 works!
I’ve found two of your secret areas on “Hide”! Is there a third? I will find it, eventually.

It’s about 08:50 now. Still 40 minutes to my coffee break. Time doesn’t fly on my job (except when I have an important deadline). At least it is Friday.
Bye
// Loffy


(Drakir) #9

What the alertentity actually do is to toggle the “startactive”. Just like when u have a forward spawnflag. When u touch the flag it toggles the spawns on and off.

I have spawns in my map that is not turned invis when activated or deactivated. I only use “alertentity” for that matter.

But i see your point with no one being able to use it when destroyed. So maybe the best way is the way u did it.


(Drakir) #10

Yeah i made the halftrack with brushes, its on my page as a prefab.
And yes there is 3 secret areas, so i guess u have to work some more to find the last :smiley: