Duke4.net Forums: EDuke32 Scripting - Duke4.net Forums

Jump to content

  • 87 Pages +
  • « First
  • 85
  • 86
  • 87
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   Danukem 

  • Duke Plus Developer

#2581

You can, but it's hacky. Spawning an SE will crash the game, so you spawn a different picnum, then change the picnum to SE, change the statnum to 3, and give it lotag 49, hitag for distance, xvel/yvel/zvel 0-255 for the RGB color you want. Importantly, make sure it gets deleted after a few tics, and that means you have to mark it for deletion in some way, have it use a timer and then delete itself in EVENT_GAME.
0

User is offline   Reaper_Man 

  • Once and Future King

#2582

Say I have ACTOR1 and want to check if ACTOR2 has a per-actor gamevar set to a certain value.

How would I read (or write) another actor's per-actor gamevar? This seems simple and I'm sure I'm overlooking something obvious.
0

User is offline   Danukem 

  • Duke Plus Developer

#2583

View PostReaper_Man, on 22 September 2020 - 08:16 AM, said:

Say I have ACTOR1 and want to check if ACTOR2 has a per-actor gamevar set to a certain value.

How would I read (or write) another actor's per-actor gamevar? This seems simple and I'm sure I'm overlooking something obvious.


It is simple, but you have to have the sprite ID number of the other actor in a gamevar first. That's the only part that can be tricky, depending on the context. But let's say you have done that already, by using findnearactor or by searching sprites via a loop or whatever.

Assume that "SPRITE" is a var that is set to the ID of the other sprite, and "VAR1" is a per-actor var. Then, in the code of an actor, you could write:

getactorvar[SPRITE].VAR1 VAR1

The above line would copy the value of VAR1 from the sprite SPRITE to the VAR1 in the current sprite (THISACTOR).

setactorvar[SPRITE].VAR1 VAR1

That would write the current copy of VAR1 in THISACTOR to the copy of that var in SPRITE

You can also abbreviate those commands to getav and setav
1

User is offline   Mark 

#2584

never mind, dan beat me to it

This post has been edited by Mark: 22 September 2020 - 09:04 AM

0

User is offline   Reaper_Man 

  • Once and Future King

#2585

Thanks guys, I had completely forgotten about get/setactorvar. I knew it was going to be something simple!
0

Share this topic:


  • 87 Pages +
  • « First
  • 85
  • 86
  • 87
  • 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