Jump to content
  • 0
Sign in to follow this  
Indomitus

RESOLVED [YLD-12128] Entity Templates not spawning correctly

Question

I am working on a PVP arena map (inspired by the Sky Arena, of course).  Part of the logic in the scenario is to spawn different weapons or armor at random, at certain reference points.  To enable the randomization, I have a couple of arrays with references to a selection of Entity Templates.  They're divided into "tier 1" "tier 2" of "tier 3" based on how strong or what type they are.  For the guns (tier 3) I have to use templates because I want them to be loaded when they spawn, and don't plan to spawn any more ammunition.

I had the Spawn Entity command tiles in the main "SpawnWeapons" sequence, but separated them when I started seeing the error, hoping to make it work.  The error happens whether I use a random one from the array, or put in a reference to a specific Entity Template.  Strange thing is, the command does work with some of the templates.  The one for the Iron Sword spawns like it is supposed to, if I put it in as a direct reference.

Entity_Code.thumb.jpg.a58d356bb34d0100173eddc58d3681a0.jpg

Entity_Error.jpg.2faee25c009811ca7efc9a3be8a36364.jpg

 

SKY_OCTAGON_ARENA.zip

Share this post


Link to post
Share on other sites

3 replies to this bug / suggestion

Recommended Posts

  • 0

Hi, thank you for your bug report with an attached game. You found the real issue on your own. Box trigger zone seams to not work correctly with some items so the game thinks that spawned Iron maced is spawned into tz_OBJECT_KILL(even though it is spawned far away from it) so it is destroyed in the middle of its spawn. Unfortunatelly error message is not useful this time.

Rotating tz_OBJECT_KILL trigger zone by 45° in y axis could help until bug is properly fixed. (after fix changed it back to be axis aligned (no rotation), just performance issue)

Share this post


Link to post
Share on other sites
  • 0

I found something this evening.  While testing something else, I noticed this in my Player Log:

Quote

## Error
# Wrong argument type in call SPAWN ENTITY at argument Type. Expected ENTITY TYPE but provided ENTITY TEMPLATE (tier3_REPEATING_RIFLE)
Stack trace:
SPAWN ENTITY(Template, Position, Orientation) (#237) in gs_WEAPON_SPAWN_CONTROL (ID:77)
SpawnTier3() (#207) in gs_WEAPON_SPAWN_CONTROL (ID:77)
SpawnWeapons() (#2) in tt_WEAPON_SPAWN (ID:78)
ON TRIGGER ENTER(Trigger object) (#1) in tz_OBJECT_KILL (ID:10)

## Error
# Wrong argument type in call SPAWN ENTITY at argument Type. Expected ENTITY TYPE but provided ENTITY TEMPLATE (tier2_IRON_MACE)
Stack trace:
SPAWN ENTITY(Template, Position, Orientation) (#243) in gs_WEAPON_SPAWN_CONTROL (ID:77)
SpawnTier2(SpawnPoint) (#211) in gs_WEAPON_SPAWN_CONTROL (ID:77)
SpawnWeapons() (#2) in tt_WEAPON_SPAWN (ID:78)
SpawnWeapons() (#2) in tt_WEAPON_SPAWN (ID:78)
ON TRIGGER ENTER(Trigger object) (#1) in tz_OBJECT_KILL (ID:10)

## Error
# Wrong argument type in call SPAWN ENTITY at argument Type. Expected ENTITY TYPE but provided ENTITY TEMPLATE (tier2_IRON_MACE)
Stack trace:
SPAWN ENTITY(Template, Position, Orientation) (#243) in gs_WEAPON_SPAWN_CONTROL (ID:77)
SpawnTier2(SpawnPoint) (#211) in gs_WEAPON_SPAWN_CONTROL (ID:77)
SpawnWeapons() (#2) in tt_WEAPON_SPAWN (ID:78)
SpawnWeapons() (#2) in tt_WEAPON_SPAWN (ID:78)
SpawnWeapons() (#2) in tt_WEAPON_SPAWN (ID:78)
ON TRIGGER ENTER(Trigger object) (#1) in tz_OBJECT_KILL (ID:10)

## Error
# Wrong argument type in call SPAWN ENTITY at argument Type. Expected ENTITY TYPE but provided ENTITY TEMPLATE (tier3_REPEATING_RIFLE)
Stack trace:
SPAWN ENTITY(Template, Position, Orientation) (#237) in gs_WEAPON_SPAWN_CONTROL (ID:77)
SpawnTier3() (#207) in gs_WEAPON_SPAWN_CONTROL (ID:77)
SpawnWeapons() (#2) in tt_WEAPON_SPAWN (ID:78)
SpawnWeapons() (#2) in tt_WEAPON_SPAWN (ID:78)
SpawnWeapons() (#2) in tt_WEAPON_SPAWN (ID:78)
SpawnWeapons() (#2) in tt_WEAPON_SPAWN (ID:78)
ON TRIGGER ENTER(Trigger object) (#1) in tz_OBJECT_KILL (ID:10)

## Error
# Wrong argument type in call SPAWN ENTITY at argument Type. Expected ENTITY TYPE but provided ENTITY TEMPLATE (tier3_REPEATING_RIFLE)
Stack trace:
SPAWN ENTITY(Template, Position, Orientation) (#237) in gs_WEAPON_SPAWN_CONTROL (ID:77)
SpawnTier3() (#207) in gs_WEAPON_SPAWN_CONTROL (ID:77)
SpawnWeapons() (#2) in tt_WEAPON_SPAWN (ID:78)
SpawnWeapons() (#2) in tt_WEAPON_SPAWN (ID:78)
SpawnWeapons() (#2) in tt_WEAPON_SPAWN (ID:78)
SpawnWeapons() (#2) in tt_WEAPON_SPAWN (ID:78)
SpawnWeapons() (#2) in tt_WEAPON_SPAWN (ID:78)
ON TRIGGER ENTER(Trigger object) (#1) in tz_OBJECT_KILL (ID:10)

 

It seemed strange to me that every stack trace included a mention of tz_OBJECT_KILL which has nothing to do with the code that was having an error.  That trigger zone is only there for cleanup, to catch any objects that fall from the map.  It is not anywhere near the spawn locations and should not be triggered anywhere in that sequence.

I disabled that trigger zone, and now the spawns all work correctly.

I think this raises more questions than it answers, but I'm happy to finally be able to move on to the effects and other game logic, like the Leaderboard.

 

  • Thanks 1

Share this post


Link to post
Share on other sites
  • 0

Thank you for the reply.  For this scenario, I decided to remove that trigger zone and use a different strategy for cleaning up excess items.  The new strategy also cleans up items dropped on the map and allows for some interesting effects, so it is better anyway.

I will give close attention to my trigger zones, if I see the error again.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×