Duke4.net Forums: Odd spawning problem - Duke4.net Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Odd spawning problem

User is offline   Mark 

#1

I have a replacement enemy models, tile 7180 for the Drone, and tile 7190 for the Octobrain. When placed in the game manually both replacements work fine. But when I use a touchplate to spawn them, the models don't show but the enemies are there following the player around the map and attacking. So the enemies are spawning but not showing. Has anyone else run across this?

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

0

User is offline   Danukem 

  • Duke Plus Developer

#2

When you code a new enemy, you need to use sizeat to set the size, otherwise they will spawn extremely small -- so small they may seem invisible. Don't forget to set cstat as well.
0

User is offline   Mark 

#3

I'm guessing that if I increase sizeat, manually placed enemies will then be way too big? If so then I'll just have to make sure all of them are spawned somehow.

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

0

User is offline   Danukem 

  • Duke Plus Developer

#4

View PostMark., on 26 May 2014 - 09:57 AM, said:

I'm guessing that if I increase sizeat, manually placed enemies will then be way too big?


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.
0

User is offline   Danukem 

  • Duke Plus Developer

#5

View PostMark., on 26 May 2014 - 09:57 AM, said:

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. :)


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.
1

User is offline   Mark 

#6

So now I just need to figure out where to add it in for those 2 enemies because neither one has the command now. Thanks.

This post has been edited by Mark.: 26 May 2014 - 10:11 AM

0

User is offline   Hendricks266 

  • Weaponized Autism

  #7

View PostTrooper Dan, on 26 May 2014 - 10:07 AM, said:

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.

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

1

User is offline   Mark 

#8

I slipped in the sizeat line just underneath an "actor" line in the Drone code and it solved the problem. They seem close enough in size between Mapster and Eduke, spawned or manually placed.
Now hopefully I have the same luck with the Octobrain.

This post has been edited by Mark.: 26 May 2014 - 10:24 AM

0

User is offline   Mark 

#9

View PostTrooper Dan, on 26 May 2014 - 10:09 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.

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

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#10

View PostHendricks266, on 26 May 2014 - 10:14 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


To resize enemies you should use EVENT_SPAWN instead of these.
0

User is offline   Mark 

#11

Hendricks266: Using just the sizeat command was enough. There is no shrinker weapon in my mod so that's not an issue. But as usual, I copy and paste these useful bits of code you guys posted into a text file in case they come in handy later on.

This post has been edited by Mark.: 26 May 2014 - 11:15 AM

0

User is offline   Danukem 

  • Duke Plus Developer

#12

I'm aware of the potential issues with shrinkers etc. and how to use events, but when trying to help a novice coder I keep it simple to promote learning :) Talking about those events might just be confusing at this point.
0

User is offline   Mark 

#13

Related to my previous issue is this... I used a Masterswitch once before to trigger c9 explosions with a delay in between each one by setting the hitag and lotags of each c9 sprite. But I can't figure out how I would accomplish the same delayed spawning of the enemies with the respawn sprite.

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

0

User is offline   Danukem 

  • Duke Plus Developer

#14

View PostMark., on 26 May 2014 - 11:36 AM, said:

The reason I want the delay is so that all of the same type of monster are not moving in sync with each other.


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.
1

User is offline   Mark 

#15

That makes sense. I'll see what I can come up with. They already initialise at standing and as soon as the player sees them they switch to walking. So I would work that ifrnd in at that point ?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options