Spawnpoint, script, alterentity, setautospawn


(Loffy) #1

Hi !
Im trying to interpret the Goldrush script and spawn entities.
When allies steal tank, the function “allies_steal_tank” is called. (See Goldrush script, around line 90.) This function has the following three lines: “alertentity tankdepot_axis_spawn” (the axis’ red spawn box in tank depot room), “alertentity tankdepot_allied_spawn” (the allies spawn box in the same room) and “alertentity tankdepotblob” (the yellow entity, in tank spawn room).
What is this “alertentity”? What is it doing?
The next two lines are: “setautospawn ‘Axis spawn’ 0” and “setautospawn ‘Tank depot’ 1”. Those lines I understand. They stop axis from spawning there (in the tank depot room) and allows allies to spawn there.

What I want to understand is how the script works, when the new spawnpoints are set for the two teams, when critical events take place (like the tank has been stolen, a wall has been breached or something similar).
Thanks in advance
// Loffy


(Drakir) #2

Hoping i am right about this, but a “alertentity” is an entity you call upon in the script. So to say you want a siren to sound you can activate that trigger_speaker entity by calling upon it´s scriptname in the script.

setautospawn is the key to set what spawnpoint should be used as autospawning place. Like in Rhine i have a forward flag, when the forward flag is used, it´s like a button it calls upon the script and sets the spawning place to the forward spawn instead of the rear.

To be able to set spawnplaces you need to add a team_WOLF_objective near the spawnareas. And give them the proper “description”.


(Loffy) #3

Ok, so I can have an “alertentity” calling a target_speaker" to play, for example, a siren when a wall is breached.
Followup question: why isnt this target_speaker playing that siren sound right from the start? what is it, that makes it stay silent, until the breached wall (via the script) calls for it?

And, why is “alertentity” used in the goldrush script? Why are spawnboxes and the yellow blob alerted (when tank is stealed)?

I mean, the next lines int the script say: setautospawn tank depot 1, and axis spawn 0. (= allies start spawning at tank depot, and axis spawn back home, at axis spawn, near bank.) That could be enough? (Up until then, it had been setautospawn tankdepot 0 and allied spawn 1.)

// Loffy
PS. i enjoyed playing Rhine2 last nite. Nice map D!


(SCDS_reyalP) #4

In general, alertentity is the same as triggering the named entity. In RTCW there were some particular cases where this failed. Usually this had to do with the triggered entity wanting to know something about the entity that triggered it.

I suspect the spawns in goldrush are alerted to enable them.


(sock) #5

Alertentity is a script command for triggering an entity or switching its state. This is from the ET reference manual - Glossary.

Triggering an Entity
To trigger an entity is to activate a certain state / specific function and it varies from entity to entity. With spawnpoint entities they will be turn on or off, while a func_explosion will simple explode and be removed from the game. The only disadvantage to triggering entities is that you cannot set the state of an entity to a specific value with the trigger function.

In order to trigger an entity it must have a targetname key/value so that the script system can refer to it. It’s a good idea to make the targetname values more meaningful and not rely on the default ‘txxxx’ name system of the editor. It can help with debugging of the map / script later on.

In the case of the spawnpoints in the tank bay spawn room it switches off the Axis entities which by default are enabled. (Check the spawnflags) The alertentity also switches on the Allied spawn entities which are disabled by default. (Check the spawnflags) This script command can be used on many different types of entities and do different task depending on the entity.

Setautospawn is a new feature of ET which automatically moves players “default” spawn location when the team capture temporary/permenantly locations. If the player chooses a different spawn location on the limbo menu then this script command is useless. It was really designed for the “n00b” player who just want to spawn and play and not have to keep choosing different spawn locations all the time.

All maps should setup the default (autospawn) locations at the beginning of the map and update if either team progress across a map towards the final objective.

Sock
:moo:


(Loffy) #6

In this map, axis attack and allies defend. I havent got the spawnings to work, yet. But i will.
I want four spawnareas in total. Two for each team.
Axis has one initial spawnarea, and another area further ahead (closer to their main objective). The axis second spawn area becomes active only after axis have completed a task (like breaching a wall or something).

The geometry of the map, from left to right (Axis are attacking):
Axis1st spawn area - - - - Axis2nd area - - Here is a task for axis (breaching a wall) - - Allies1st spawn area - - - - Allies 2nd area - - - - Main objective, for Axis to steal/blow and Allies to defend.

So, the allies spawn initially somewhere in the middle of the map. And when the axis have breached the wall, they are forced to spawn further back, closer to the main thing they are defending.
I will try to make this work today. It’s hard to get all flags work on screen, to get spawnareas to work and so on. But now I’ll stop whining and start scripting!
:banana:
Loffy

EDIT: Thanks for your reply Sock. It pointed me in the right directions.


(Loffy) #7
  1. Additional info., to previous post: I have four yellow blobs, one for each spawnarea.
  2. Just to confirm: The setautospawn always calls the yellow blob, and the Description, right? As in: setautospawn “Tank depot” 1.
    EDIT: Yes, it’s in the manual, appendix A: “setautospawn <target spawn> <team>. Set the autospawn of a team to target spawn. The target spawn string is the ‘description’ key on the team_WOLF_objective.”
    // L.

(Loffy) #8

Still working… getting some progress. Read some old threads in SD forum.
I have a short question: How can I hide a yellow blob initially?
I have two blobs for one team. The first is for the first spawn. First spawn should be visible on map. It is also the only place where the team can spawn, initially, since the second ctf-spawn is inactive at start.
However, the second spawnpoint is visible on command map. Since the yellow blob (at second spawn) is there.
(It is the yellow blob that shows up on map.)
How can I hide the second blob, so the flag isnt visible (untill it should be visible - later in the game)?
There must be a way to set yellow blob (team_wolf_objective) at second spawn “hidden”/dormant, in the script.
Thx in advance
Loffy


(sock) #9

I assume you mean the “yellow blob” as the “team_WOLF_objective” entity. Have a look at the (.lms) scripts. Alot of the multiple/extra spawn locations had to be hidden for the LMS game play. They have to be hidden straight away otherwise the Limbo menu will find them and display them.

Use the following script command: setstate <team_WOLF_objective> invisible

The setstate command simple needs the targetname for the “team_WOLF_objective”.

I would be careful placing “team_WOLF_objective” too close to each other, because all spawnpoints trace a path to the nearest “team_WOLF_objective” for spawning purposes. If you want to switch a “team_WOLF_objective” between teams just “alertentity” it, dont create one for each team as it will cause problems with the spawning system.

Look at the fueldump script for example when the tunnel doors are destroyed. (line 3521>) The “team_WOLF_objective” is switched from one team to the other, the spawnpoints are toggled on/off for each team and the autospawn feature is updated.

Sock
:moo:


(Loffy) #10

Roger.
// Loffy


(Loffy) #11

Hi!
I got all my spawnpoints to work. Four spawnpoints. The round works perfect.
But there is one problem…
When the game is over (time is up) and a new round starts (same map), one of the teams spawn at their second spawn point.
But this is only for the absolute beginning of the round. After a member of this team is killed, he or she repspawns in the first spawn position, just like I want it to be.

I want both teams to have their intial spawn in their first spawn areas respectively. (It works perfect for the other team: when a new round starts, they spawn in their initial spawn area, the first spawn area for this team, and only there.)

Just these scribbled lines to let you know. I will continue to work on this for a few hours. It might work - eventually :slight_smile:

Loffy