Duke4.net Forums: How to get lotag and hitag from sprite? - Duke4.net Forums

Jump to content

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

How to get lotag and hitag from sprite?

User is offline   Superthijs 

#1

Hi,
I've made an enemy-spawning sprite, but I want it to spawn the actor defined in the sprite's lotag.
I mean that if the sprite's lotag is 1680, it spawns a Lizard trooper.
How do I do this?
0

User is offline   Inspector Lagomorf 

  • Glory To Motherland!

#2

View PostSuperthijs, on 17 February 2012 - 09:51 AM, said:

Hi,
I've made an enemy-spawning sprite, but I want it to spawn the actor defined in the sprite's lotag.
I mean that if the sprite's lotag is 1680, it spawns a Lizard trooper.
How do I do this?


At the risk of sounding trite, is there a reason why a RESPAWN sprite would not work just as well?
0

User is offline   CruX 

#3

View PostSuperthijs, on 17 February 2012 - 09:51 AM, said:

Hi,
I've made an enemy-spawning sprite, but I want it to spawn the actor defined in the sprite's lotag.
I mean that if the sprite's lotag is 1680, it spawns a Lizard trooper.
How do I do this?


To get the actor's lotag, you have to run an eventloadactor block on it, grab its lotag value and put it into a temporary var, then set the lotag to zero. Then in the actor's actual code, you can grab the lotag by using getactorvar (rather than just getactor). After that either espawnvar or eqspawnvar will spawn whatever's specified in the lotag in mapster.


View PostThe Mighty Bison, on 17 February 2012 - 09:57 AM, said:

At the risk of sounding trite, is there a reason why a RESPAWN sprite would not work just as well?


Sometimes an actor's ai may not jive with RESPAWN since whatever it spawns will automatically be awake. Also, I might be wrong, but IIRC you can't spawn anything with a nonzero palette either.
0

User is offline   TerminX 

  • el fundador

  #4

The functionality could easily be added to propagate the palette of the RESPAWN sprite to whatever it spawns, but it would change gameplay. It was clearly intended to work that way at some point however as there are a few RESPAWN sprites with pal 21 that spawn LIZTROOPS. For example, the LIZTROOP that spawns in the theater in E1L1 was actually supposed to be an assault captain de-cloaking, not just a regular trooper materializing out of nowhere.
1

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#5

Doesn't it works that way with the Battlelord? Or it has something to do with Assault Trooper code to automatically change the palette to 22?
0

User is online   Danukem 

  • Duke Plus Developer

#6

View PostFox, on 17 February 2012 - 11:03 AM, said:

Doesn't it works that way with the Battlelord? Or it has something to do with Assault Trooper code to automatically change the palette to 22?


It works with battlelord pal 21, but it doesn't work in general.

I can be easily fixed with the following CON code, however:

gamevar temp 0 0

onevent EVENT_EGS

ifspawnedby RESPAWN
{
  getactor[THISACTOR].owner temp
  setactor[THISACTOR].pal sprite[temp].pal
}
endevent

0

User is offline   Superthijs 

#7

View PostThe Mighty Bison, on 17 February 2012 - 09:57 AM, said:

At the risk of sounding trite, is there a reason why a RESPAWN sprite would not work just as well?


It needs to spawn an enemy each couple of seconds.
0

#8

View PostSuperthijs, on 18 February 2012 - 05:05 AM, said:

It needs to spawn an enemy each couple of seconds.


I've made a spawner actor as one of my first actors as well. It's very effective, you can add a lot of cool things with an actor like this. If you want some ideas or some code examples, just pm me.
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