Odd spawning problem
#1 Posted 26 May 2014 - 08:57 AM
My first thought was to raise or lower the spawn sprite in case they were spawning in the ground or up in the ceiling. No help there. Maybe because its not a legit actor, just a replacement?
This post has been edited by Mark.: 26 May 2014 - 09:11 AM
#2 Posted 26 May 2014 - 09:36 AM
#3 Posted 26 May 2014 - 09:57 AM
EDIT: Also I don't see a sizeat command in game con for the drone or octobrain. I'm screwed unless I make these 2 custom enemies.
This post has been edited by Mark.: 26 May 2014 - 10:06 AM
#4 Posted 26 May 2014 - 10:07 AM
Mark., on 26 May 2014 - 09:57 AM, said:
No. If you have a line of code that says "sizeat 40 40", then it will make them 40x40, regardless of whether they are spawned or placed in mapster. The code will take effect after the actor initializes, so they will start at the mapster size and then change to the coded size when you see the actor.
#5 Posted 26 May 2014 - 10:09 AM
Mark., on 26 May 2014 - 09:57 AM, said:
That's because those enemies are hardcoded to start at a certain size. Enemies that you code yourself on previously unused tile numbers must be coded to have the size you want.
#6 Posted 26 May 2014 - 10:10 AM
This post has been edited by Mark.: 26 May 2014 - 10:11 AM
#7 Posted 26 May 2014 - 10:14 AM
Trooper Dan, on 26 May 2014 - 10:07 AM, said:
Mark, to avoid this, use EVENT_LOADACTOR. Throw in an EVENT_EGS so using a spawn command (such as a RESPAWN sprite) will work too. I wouldn't recommend keeping a sizeat in the main actor block because then the shrinker won't work correctly.
state enemysize ifactor NEWENEMY sizeat 40 40 else ifactor NEWENEMY2 sizeat 40 40 ends onevent EVENT_LOADACTOR state enemysize endevent onevent EVENT_EGS state enemysize endevent
#8 Posted 26 May 2014 - 10:23 AM
Now hopefully I have the same luck with the Octobrain.
This post has been edited by Mark.: 26 May 2014 - 10:24 AM
#9 Posted 26 May 2014 - 10:27 AM
Trooper Dan, on 26 May 2014 - 10:09 AM, said:
That is why I was having this issue with only these two enemies. I'm using original Drone and Octobrain code in GAME.CON for these. My other custom enemies spawn fine.
EDIT: I can scratch that problem off the list and move on to the next part.
This post has been edited by Mark.: 26 May 2014 - 10:42 AM
#10 Posted 26 May 2014 - 11:07 AM
Hendricks266, on 26 May 2014 - 10:14 AM, said:
state enemysize ifactor NEWENEMY sizeat 40 40 else ifactor NEWENEMY2 sizeat 40 40 ends onevent EVENT_LOADACTOR state enemysize endevent onevent EVENT_EGS state enemysize endevent
To resize enemies you should use EVENT_SPAWN instead of these.
#11 Posted 26 May 2014 - 11:13 AM
This post has been edited by Mark.: 26 May 2014 - 11:15 AM
#12 Posted 26 May 2014 - 11:19 AM
#13 Posted 26 May 2014 - 11:36 AM
EDIT: If there is no elegant solution I'll just create a few smaller sectors, each having their own touchplate and see if there is enough delay in between the spawns. The reason I want the delay is so that all of the same type of monster are not moving in sync with each other.
This post has been edited by Mark.: 26 May 2014 - 11:52 AM
#14 Posted 26 May 2014 - 05:21 PM
Mark., on 26 May 2014 - 11:36 AM, said:
Do you mean their animation is syncing? I don't see why that would be a problem, but if it is you can just add a small random delay before they start walking. A few lines of code is a lot easier than making a bunch of little sectors and differently tagged plates. In case that's not clear, what I mean is this: have them initialize to a standing position instead of walking. While standing they are awake, able to take damage, etc., they just aren't moving or animating. When in that state, they use something like ifrnd 32 ai AISEEKPLAYER, or whatever you want to use to transition them to their normal routine where they come after the player.