
EDuke32 Scripting "CON coding help"
#3533 Posted 05 August 2024 - 03:23 PM
I noticed that when the player is shrunk useractor enemies do not track the player's position like the other original enemy actors do. Is there a way to get useractor enemies to track the player's position like the originals? I'm trying to get small spider actors to track the player position when they are shrunk but they seem to ignore the player altogether.
#3534 Posted 06 August 2024 - 01:18 AM
VGames, on 05 August 2024 - 03:23 PM, said:
I noticed that when the player is shrunk useractor enemies do not track the player's position like the other original enemy actors do. Is there a way to get useractor enemies to track the player's position like the originals? I'm trying to get small spider actors to track the player position when they are shrunk but they seem to ignore the player altogether.
One thing to be aware of is that ifp palive returns false when the player shrunk. So if your enemies check for whether the player is alive before following, that might explain it.
It's instructive to look at the code for NEWBEAST, which is a useractor. Notice that it explicitly will enter its seeking state when the player is shrunk. Once in that state, it does check for whether ifp pdead is true, but only when deciding whether to shoot or scratch. It will not leave the seeking state just because the player is "dead".
#3535 Posted 06 August 2024 - 05:47 AM
Oh ok that helps a lot. I have been using ifpalive so that must be the issue. Thanks for the clarification.
#3536 Posted 30 August 2024 - 04:56 PM
How do you check for the height of the ceiling in the current sector that you are in? I thought there was a real easy way to do it but ceilingz isn't exactly what I'm looking for. I'm trying to get the height of the ceiling that you see in mapster when you're pointing at it in 3D mode.
#3537 Posted 30 August 2024 - 09:14 PM
VGames, on 30 August 2024 - 04:56 PM, said:
How do you check for the height of the ceiling in the current sector that you are in? I thought there was a real easy way to do it but ceilingz isn't exactly what I'm looking for. I'm trying to get the height of the ceiling that you see in mapster when you're pointing at it in 3D mode.
https://wiki.eduke32...Getceilzofslope
You want that one ^ it gives you the celing z at specific x y coordinates
#3538 Posted 31 August 2024 - 01:30 PM
Doesn't this still return ceilingz? That's not the height of the ceiling, is it? That's more like the z coordinate of the ceiling which could be anything depending on the location of the map. Or am I using it wrong? Maybe I should explain what I'm trying to do. I want to check if the player is in one of those tiny tunnels that you go through when shrunk. How do I check what the height of that ceiling is so that I can make something happen when in those tiny tunnels?
#3539 Posted 31 August 2024 - 02:53 PM
sounds like what you actually want is how much distance there is between the floor and the ceiling, which means you get both values and subtract
#3540 Posted 31 August 2024 - 04:09 PM
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
#3541 Posted 31 August 2024 - 04:22 PM
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
#3544 Posted 14 September 2024 - 02:57 PM
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?
#3545 Posted 16 September 2024 - 09:48 AM
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.
#3546 Posted 01 October 2024 - 04:35 AM
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..
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
#3547 Posted 01 October 2024 - 10:15 AM
i got it working, well mostly. now the hard part starts..but it should be worth it

#3548 Posted 01 October 2024 - 01:42 PM
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.
#3549 Posted 03 October 2024 - 03:19 PM
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.
#3550 Posted 12 October 2024 - 05:34 PM
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?
#3552 Posted 14 October 2024 - 01:23 PM
Reaper_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?
#3553 Posted 14 October 2024 - 07:13 PM
VGames, 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.
#3554 Posted 14 October 2024 - 09:22 PM
Danukem, 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.
#3555 Posted 15 October 2024 - 05:32 AM
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'm surprised .rotscrnang works at all. I'd be curious why it can't work with showview, at least on a conceptual level.
#3556 Posted 15 October 2024 - 11:11 AM
Reaper_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'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.
#3557 Posted 15 October 2024 - 05:33 PM
Can showview be used by other actors? Or does this only work when the player calls on it?
#3558 Posted 15 October 2024 - 07:44 PM
VGames, 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?
#3559 Posted 16 October 2024 - 04:16 AM
Danukem, 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?
#3560 Posted 16 October 2024 - 04:29 AM
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.
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.
#3561 Posted 16 October 2024 - 10:30 AM
Reaper_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.
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.
#3562 Posted 31 October 2024 - 07:55 AM
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?