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

Jump to content

  • 124 Pages +
  • « First
  • 117
  • 118
  • 119
  • 120
  • 121
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is online   Danukem 

  • Duke Plus Developer

#3541

 VGames, on 31 August 2024 - 04:09 PM, said:

Oh ok I understand now. Get the floorz and the ceilingz and subtract them to get a number that shows the distance between them. I’ll do that. Thanks for the tip


If you are coding in the player actor you can also use the old ifgapzl command -- I think around 48 or less is crouching height

https://wiki.eduke32.com/wiki/Ifgapzl
1

User is offline   VGames 

#3542

I'll take a look at that too. Thanks
0

User is offline   VGames 

#3543

ifgapzl was exactly what I was looking for. Thanks.
0

User is offline   VGames 

#3544

Is it possible to replicate how players playing as the xenomorphs in the Aliens vs Predator franchise can run on walls and the ceiling with Eduke32? If so, has anybody ever done this before and what commands would be helpful to accomplish this?
0

User is online   Danukem 

  • Duke Plus Developer

#3545

There's no one magical code bullet that will make that happen, it's a combination of different tricks and methods, and the game will fight you every step of the way. One thing I'll mention is rotating the screen: https://wiki.eduke32...wiki/Rotscrnang which is useful for both wall running and upside down movement.
0

User is offline   jimbob 

#3546

ok, maybe a stupid question, but how do i trigger an actor using activators or masterswitches?

i can do the inverse with operatemasterswitches and operateactivators, but not "activating" a actor with one of those.

basically i'm trying to make a camera actor that changes the view, plays a little scene, en goes back to its neutral position ( also resets the switch to prevent re-triggering the events )

since the scene will have a random(ish) set of things happening instead of being a one time thing i basically need to have it operate this way.

asa side question, with "tint { pal 0 flags 9 }" applied to all pals, i can make the game run in black and white mode, but that code is initiated in a .defs file, is there a similar function i can use on the fly ingame? it might be fun to have the camera turn the screen to BnW mode.

[edit] it might actually be easier to set up a custom actor with the ifhitspace trigger and run from there..

This post has been edited by jimbob: 01 October 2024 - 05:01 AM

0

User is offline   jimbob 

#3547

i got it working, well mostly. now the hard part starts..but it should be worth it :)
0

User is online   Danukem 

  • Duke Plus Developer

#3548

Don't know what you mean by "trigger" an actor. Activators and masterswitches are hardcoded things. It's possible but inconvenient to set up code such that when a hardcoded thing happens, it sets a var on an actor that with your script will then cause the actor to do something. What I prefer is having something non-hardcoded manipulate the actor, then I have better control over it. My typical setup would be to use the CON commands that trigger activators/masterswitches etc. be part of a code block that also runs a loop on sprites in the map and sets a var on any sharing the same channel (the channel being a var on the actor sprite at this point). So in other words the activator/masterswitch is being triggered by my own code which at the same time finds and communicates to the actor.
0

User is offline   jimbob 

#3549

i meant using a switch to activate an actor like you would do an sector effect like a door, but i was wildly overcomplicating things that way and ended up doing just what you said, making a custom actor that, when used, switches on the camera and activates the activators and whatnots.. only downside is that it does not like having hi or lotags set, it gives very funky results so i hard coded them.
0

User is offline   VGames 

#3550

So, I'm just about done with adding drivable Pigcop Recon vehicles and I added the ability to drop artillery shells while flying it using the FIRE MODE 2 Button. But I got an idea that I'm here to ask about. Is there a way to use a camera to show what's right beneath you and have that feedback displayed directly on the HUD? That way you can see what's below you as you drop bombs. If it's possible what command and variables should I look into? Any examples of this being done before?
0

User is online   Reaper_Man 

  • Once and Future King

#3551

https://wiki.eduke32.com/wiki/Showview
1

User is offline   VGames 

#3552

View PostReaper_Man, on 13 October 2024 - 03:47 PM, said:



That worked great. Thanks a lot. Is there any way to go beyond -99 for "horiz" so that the camera is looking straight down and is not restricted like the Player's view when looking as far down as possible?
0

User is online   Danukem 

  • Duke Plus Developer

#3553

View PostVGames, on 14 October 2024 - 01:23 PM, said:

That worked great. Thanks a lot. Is there any way to go beyond -99 for "horiz" so that the camera is looking straight down and is not restricted like the Player's view when looking as far down as possible?


No, it's impossible. Its also not possible to rotate the view in the way that .rotscrnang does on the player which I find to be a frustrating limitation.
0

User is offline   VGames 

#3554

View PostDanukem, on 14 October 2024 - 07:13 PM, said:

No, it's impossible. Its also not possible to rotate the view in the way that .rotscrnang does on the player which I find to be a frustrating limitation.


Ok thanks for that clarification. I figured it wouldn’t be possible. Still what I got right now is excellent as is. Thanks for the help.
0

User is online   Reaper_Man 

  • Once and Future King

#3555

The limitation is a fundamental property of the engine's renderer. It's just kind of a literal feature of how rendering natively in BUILD works. This is another cause of where the "2.5D" misconception comes from too.

I'm surprised .rotscrnang works at all. I'd be curious why it can't work with showview, at least on a conceptual level.
0

User is online   Danukem 

  • Duke Plus Developer

#3556

View PostReaper_Man, on 15 October 2024 - 05:32 AM, said:

The limitation is a fundamental property of the engine's renderer. It's just kind of a literal feature of how rendering natively in BUILD works. This is another cause of where the "2.5D" misconception comes from too.

I'm surprised .rotscrnang works at all. I'd be curious why it can't work with showview, at least on a conceptual level.


I think it could work but someone has to add the feature. Just my guess though.
0

User is offline   VGames 

#3557

Can showview be used by other actors? Or does this only work when the player calls on it?
0

User is online   Danukem 

  • Duke Plus Developer

#3558

View PostVGames, on 15 October 2024 - 05:33 PM, said:

Can showview be used by other actors? Or does this only work when the player calls on it?


I thought it only worked when used from display events. Are you successfully using it in the player actor code?
0

User is offline   VGames 

#3559

View PostDanukem, on 15 October 2024 - 07:44 PM, said:

I thought it only worked when used from display events. Are you successfully using it in the player actor code?


No my mistake. I forgot to mention I’m using it in the HUD code. One of the display events. Still couldn’t u link it to an actor this way? Like if I had the player spawn an actor behind them and have the showview use that actor’s coordinates so that the screen is showing a better view of what’s actually beneath the player? But still call on showview in the HUD code?
0

User is online   Reaper_Man 

  • Once and Future King

#3560

Yes, you can use another actor's coordinates as the coordinates for showview, essentially making a camera of their perspective.

The way you are phrasing this is very weird and doesn't make a lot of sense. I would not describe this as the actor "using" showview, and the showview command does not have any properties referencing sprite ID in the first place.
0

User is offline   VGames 

#3561

View PostReaper_Man, on 16 October 2024 - 04:29 AM, said:

Yes, you can use another actor's coordinates as the coordinates for showview, essentially making a camera of their perspective.

The way you are phrasing this is very weird and doesn't make a lot of sense. I would not describe this as the actor "using" showview, and the showview command does not have any properties referencing sprite ID in the first place.


Yeah I guess I worded it wrong. I meant you can use another’s actors coordinates besides the players for the showview command.
0

User is offline   VGames 

#3562

What commands should I look into to the get the X and y positions of an enemy so that it can be used to display something on the screen in the position they’re located using rotatesprite?
0

User is online   Danukem 

  • Duke Plus Developer

#3563

If you are trying to make a radar display, it has been done.
0

User is online   Danukem 

  • Duke Plus Developer

#3564

in my radar code, I'm mainly using rotatepoint to do the heavy lifting, with some getincangle and basic var and array manipulation
0

User is offline   VGames 

#3565

View PostDanukem, on 31 October 2024 - 11:09 AM, said:

in my radar code, I'm mainly using rotatepoint to do the heavy lifting, with some getincangle and basic var and array manipulation


I want a way to see enemy positions through walls. Like the railgun on Red Faction.
0

User is online   Reaper_Man 

  • Once and Future King

#3566

That's a big pain in the ass and involves math translating game coords to screen space coords. I do this exact thing in AWOL to display the AI Bot's stats over their heads while on screen. Take a look at awol_ui.con around the middle of the file, the "botui_xxx" statements handles it. In the "// AI Bot status display" section. There becomes a pretty big vertical desync the closer the actor is to the top or bottom of the player's screen or view, I'm pretty sure because of precision issues with the horiz property. As always, please credit Shotspark and/or AWOL if you pull any of the code wholesale.
1

User is offline   VGames 

#3567

View PostReaper_Man, on 01 November 2024 - 02:12 PM, said:

That's a big pain in the ass and involves math translating game coords to screen space coords. I do this exact thing in AWOL to display the AI Bot's stats over their heads while on screen. Take a look at awol_ui.con around the middle of the file, the "botui_xxx" statements handles it. In the "// AI Bot status display" section. There becomes a pretty big vertical desync the closer the actor is to the top or bottom of the player's screen or view, I'm pretty sure because of precision issues with the horiz property. As always, please credit Shotspark and/or AWOL if you pull any of the code wholesale.


Hey, thanks a lot for the heads up. I'll credit Shotspark and AWOL no matter what if this helps me. I'll check it out ASAP. How do you open the GRP for AWOL? Nothing I have opens it. I normally use GRPViewer.

This post has been edited by VGames: 01 November 2024 - 03:05 PM

0

User is offline   VGames 

#3568

Nevermind just figured it out
0

User is offline   VGames 

#3569

What's a good way to wake enemies up when the player is within a certain range without having to go into every one of their individual sets of code and add the scripts to call on one of their AI statements specific to them? I considered giving them a little bit of damage to wake them up but if there was a better way to start their ai as if they actually saw the player, I'd like to use that instead.

This post has been edited by VGames: 03 November 2024 - 09:16 AM

0

User is online   Reaper_Man 

  • Once and Future King

#3570

Actors go asleep in 2 ways, changing their statnum and the .httimetosleep property. You can check their .picnum to see if it matches the enemy tile ID, and then check if their statnum is set to STAT_ZOMBIEACTOR and if so set them back to STAT_ACTOR. This will turn them back into regular actors running code. Actors turn into Zombies when their "sleep time" counter exceeds 32767 (and other conditions like being too far away). So you probably want to set the .httimetosleep back to 0 when you force them out of the Zombie state to prevent them from instantly falling asleep again.
1

Share this topic:


  • 124 Pages +
  • « First
  • 117
  • 118
  • 119
  • 120
  • 121
  • Last »
  • 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