Can't Get Randomized Flag Spawns to Work

Scary Monsters

L1: Registered
Jul 13, 2022
5
0
I'm working on a project that emulates Counter-Strike's hostage mode where BLU team has to grab RED flags and brings them back to their spawn, in arena mode.
These flags are spawned in with point_templates because otherwise Arena and CTF aren't compatible, but they have to be from point_templates anyway because I use a logic_case to activate a random template which contains a select pair of flags on round start.

Logically everything seems sound, however:
  • When the round starts, this error messages appear in console for a random group of flag and template numbers each time:
Couldn't find any entities named item_teamflag*, which point_template point_template* is specifying.
  • When the templates are called to spawn the flags, usually it results in this message:
CreateInstance called on a point_template that has no templates: point_template1
  • Sometimes one flag does manage to spawn, even though all templates are flag pairs.
  • Other times everything just works and a flag pair spawns as normal.
  • As a bonus, trying to add time to team_round_timer isn't working, even when done manually through ent_fire.
Am I doing anything wrong? Is there anything that can be done to circumnavigate these issues?
 

Attachments

  • cs_zoo_hashtag_pleaseworkthistime.vmf
    51.6 KB · Views: 75
Last edited:
Solution
The reason why the later templates can't find their flags is because those flags have actually been deleted by the older templates.
1688470095851.png

This is why point_template1 works totally fine, since it's essentially reserving flags 1 and 2 for its exclusive use.

We could enable the "Don't Remove Template Entities" spawnflag to fix this, but that would break the arena logic.
So, what we have to do - even though it's ugly - is make new flags for each possible template state.

Here's an updated VMF with that in place:

Tiftid

the Embodiment of Scarlet Devil
aa
Sep 10, 2016
613
476
The reason why the later templates can't find their flags is because those flags have actually been deleted by the older templates.
1688470095851.png

This is why point_template1 works totally fine, since it's essentially reserving flags 1 and 2 for its exclusive use.

We could enable the "Don't Remove Template Entities" spawnflag to fix this, but that would break the arena logic.
So, what we have to do - even though it's ugly - is make new flags for each possible template state.

Here's an updated VMF with that in place:
 

Attachments

  • cs_zoo_tiftidedit1.vmf
    74.7 KB · Views: 82
Solution