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

Jump to content

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

EDuke32 Scripting  "CON coding help"

#2551

is there any way to read keystrokes in events EVENT_DISPLAYMENU, EVENT_CHANGEMENU, EVENT_SCREEN or when game is paused setuserdef[] .pause_on 2
This could be very useful for creating an inventory interface, for example.
0

User is offline   Sangman 

#2552

Is it possible to detect if the player has a given tilenumber in view? The way I was thinking of doing it was to do a hitscan check from every pixel covering the player's view, but that sounds entirely ridiculous.
Still, we have some functions like ifcansee that work against actors. I probably need that but for textures.


edit:

Apparently this is exposed via the gotpic array in CON.

ife gotpic[tilenum] 1 => means that tilenum is currently visible

The array doesn't reset on its own (there is an EVENT_RESETGOTPICS but from what I can tell from the source code, this only gets called when handling mirrors), but you can do so manually inside your code bock:

setarray gotpic[tilenum] 0

So far performance seems ok

Credit to Mblackwell for letting me know

This post has been edited by Sangman: 10 February 2020 - 09:29 AM

0

User is online   Trooper Dan 

  • Duke Plus Developer

#2553

View PostSangman, on 10 February 2020 - 06:44 AM, said:


ife gotpic[tilenum] 1 => means that tilenum is currently visible

The array doesn't reset on its own (there is an EVENT_RESETGOTPICS but from what I can tell from the source code, this only gets called when handling mirrors), but you can do so manually inside your code bock:

setarray gotpic[tilenum] 0



Interesting. So what exactly causes the elements to get set? For example, if a certain enemy dies in a place where no players are around, is its dead body tile "in view"? Or does it require that the tile is actually rendered on a screen?
0

User is offline   Sangman 

#2554

Good questions, which I'm sure somebody can answer :D
0

#2555

I just had another rather specific idea. I wonder if it really possible that an enemy can patrol freely in an area until he sees the player, in order to attack him? I wonder if modifying a statnum or using a sprite similar to "locator" could do that, to define a route in a sector.

This post has been edited by Firefly Trooper: 19 February 2020 - 12:48 PM

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#2556

View PostTrooper Dan, on 10 February 2020 - 09:44 AM, said:

Interesting. So what exactly causes the elements to get set? For example, if a certain enemy dies in a place where no players are around, is its dead body tile "in view"? Or does it require that the tile is actually rendered on a screen?

It requires the tile to be rendered.

This was added so the skybox in Ion Fury would only be drawn if the skybox texture (which is a blank tile) was visible.

Note that it's only set after it's rendered (meaning that in the Ion Fury example there's a 1 frame delay).
1

User is online   Trooper Dan 

  • Duke Plus Developer

#2557

View PostFox, on 19 February 2020 - 03:56 PM, said:

It requires the tile to be rendered.

This was added so the skybox in Ion Fury would only be drawn if the skybox texture (which is a blank tile) was visible.

Note that it's only set after it's rendered (meaning that in the Ion Fury example there's a 1 frame delay).


I miss-clicked and downvoted you by accident (that was supposed to be an upvote).

Anyway, that's a good feature for saving resources with an expensive command like showview
0

Share this topic:


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