EDuke32 Scripting "CON coding help"
#3331 Posted 17 July 2023 - 11:29 AM
#3332 Posted 17 July 2023 - 03:15 PM
#3333 Posted 12 August 2023 - 02:40 AM
Hello,
I ask miself how to create a condition that cancels the effect of the "strafe left", "strafe right", "crouch" and "jump" movements of the player ... for the code of the use of a custom vehicle by the player, but not find a solution...
Within the EVENT_STRAFELEFT, EVENT_STRAFERIGHT i guess ??
Thank in advance
I ask miself how to create a condition that cancels the effect of the "strafe left", "strafe right", "crouch" and "jump" movements of the player ... for the code of the use of a custom vehicle by the player, but not find a solution...
Within the EVENT_STRAFELEFT, EVENT_STRAFERIGHT i guess ??
Thank in advance
#3334 Posted 12 August 2023 - 12:46 PM
zazo, on 12 August 2023 - 02:40 AM, said:
Hello,
I ask miself how to create a condition that cancels the effect of the "strafe left", "strafe right", "crouch" and "jump" movements of the player ... for the code of the use of a custom vehicle by the player, but not find a solution...
Within the EVENT_STRAFELEFT, EVENT_STRAFERIGHT i guess ??
Thank in advance
I ask miself how to create a condition that cancels the effect of the "strafe left", "strafe right", "crouch" and "jump" movements of the player ... for the code of the use of a custom vehicle by the player, but not find a solution...
Within the EVENT_STRAFELEFT, EVENT_STRAFERIGHT i guess ??
Thank in advance
For strafing you can cancel the corresponding movement bits:
https://wiki.eduke32...i/Movement_lock
For jumping and crouching, set RETURN to -1 in the corresponding events.
#3335 Posted 13 August 2023 - 07:58 PM
Even though this is more of a source related question I didn’t know where to post it so I figured this thread would work. How hard would it be to get sprites being used as decals on walls, floors, or ceiling surfaces take into account the edge of the surface they are on and have the decal bend along with the angle of the surface like decals do in the GZDoom engine? Just wondering if something like this could ever get added to a future eduke release so that decals don’t stick out when they reach the edge of a wall or something.
#3337 Posted 14 August 2023 - 07:48 AM
I figured it was difficult since it’s never been implemented. Is it something that would require a full rework of something that everything depends on? I’m just curious. I have no idea how it all works engine wise.
#3338 Posted 14 August 2023 - 12:44 PM
VGames, on 13 August 2023 - 07:58 PM, said:
Even though this is more of a source related question I didn’t know where to post it so I figured this thread would work. How hard would it be to get sprites being used as decals on walls, floors, or ceiling surfaces take into account the edge of the surface they are on and have the decal bend along with the angle of the surface like decals do in the GZDoom engine? Just wondering if something like this could ever get added to a future eduke release so that decals don’t stick out when they reach the edge of a wall or something.
You can always just use two sprites for a decal around an angled corner that would seam where the two walls meet. Implementing this from the engine side, leaving aside the difficulties with it, would break a lot of details which rely on "cutting" a sprite with a wall.
#3339 Posted 14 August 2023 - 08:45 PM
Aleks, on 14 August 2023 - 12:44 PM, said:
You can always just use two sprites for a decal around an angled corner that would seam where the two walls meet. Implementing this from the engine side, leaving aside the difficulties with it, would break a lot of details which rely on "cutting" a sprite with a wall.
I'm pretty sure he was asking because he has big decals spawned by projectiles during gameplay. What you are suggesting sounds like a mapper solution and wouldn't help.
AFAIK there is no data in the engine for determining when a decal is hanging over an edge, let alone any rendering capability for "bending" a flat sprite.
When addressing this issue in my own projects, because of large rocket scorch decals, the best I could come up with was to try and detect nearby edges by testing for wall/sector changes at certain distances in various directions from the decal when it spawns, then reducing its size accordingly or simply deleting it.
#3340 Posted 15 August 2023 - 04:34 AM
Danukem, on 14 August 2023 - 08:45 PM, said:
I'm pretty sure he was asking because he has big decals spawned by projectiles during gameplay. What you are suggesting sounds like a mapper solution and wouldn't help.
AFAIK there is no data in the engine for determining when a decal is hanging over an edge, let alone any rendering capability for "bending" a flat sprite.
When addressing this issue in my own projects, because of large rocket scorch decals, the best I could come up with was to try and detect nearby edges by testing for wall/sector changes at certain distances in various directions from the decal when it spawns, then reducing its size accordingly or simply deleting it.
AFAIK there is no data in the engine for determining when a decal is hanging over an edge, let alone any rendering capability for "bending" a flat sprite.
When addressing this issue in my own projects, because of large rocket scorch decals, the best I could come up with was to try and detect nearby edges by testing for wall/sector changes at certain distances in various directions from the decal when it spawns, then reducing its size accordingly or simply deleting it.
Yeah I was referring to non mapping methods of keeping decals from hanging over wall or floor edges. I’ve adopted this method of yours Dan. It’s very useful and works for the most part. I was just curious about having something similar to what u see in modern engines when it comes to decals wrapping around corners. Thanks for the info.
#3341 Posted 25 August 2023 - 05:02 AM
I noticed when I start a map sometimes sound effects like weapon firing sounds will cause the game to have a real quick drop in frame rate. It’s very quick and doesn’t cause much issue but it is noticeable. I’ve seen people using GZDOOM talk about this happening to them as well and they said it was the sound effect getting added to RAM. Since there isn’t a way to precache sound effects in GZDOOM they work around this by playing sound effects during the loading screen. Is this something that could be done with eduke or is there a better way to go about keeping sound effects from causing the game to stutter when being played for the first time?
#3342 Posted 25 August 2023 - 01:28 PM
tbh the issues I've had with *images* loading in and causing terrible lag/stuttering overshadow sound issues to such a degree that I've never thought about it. But I guess you could try using the screensound command in events before gameplay to see if that does anything
#3343 Posted 06 September 2023 - 04:34 PM
I've noticed something very odd. When you set the player's Z position to make them appear taller as if they are in a big mech it causes enemies to do self-damage to themselves.
Code like above causes the enemies to die when shooting at you while your z position is being set manually to a higher-than-normal setting. Even using the add cameraz command instead causes the same issue but it's not ideal since it makes the weapon projectile offsets all messed up. Has anybody noticed this before and is there a work around? I tried adding health to the enemies when they shoot at you while you are this high up, but they still die. Even setting their health to their maximum amount constantly does nothing. They still die over time. I've also tried reducing the amount of added height and it still causes the enemies to kill themselves even at much lower settings.
getsector[THISACTOR].floorz Z addvar Z -34500 setp[].posz Z
Code like above causes the enemies to die when shooting at you while your z position is being set manually to a higher-than-normal setting. Even using the add cameraz command instead causes the same issue but it's not ideal since it makes the weapon projectile offsets all messed up. Has anybody noticed this before and is there a work around? I tried adding health to the enemies when they shoot at you while you are this high up, but they still die. Even setting their health to their maximum amount constantly does nothing. They still die over time. I've also tried reducing the amount of added height and it still causes the enemies to kill themselves even at much lower settings.
This post has been edited by VGames: 06 September 2023 - 04:35 PM
#3344 Posted 06 September 2023 - 09:12 PM
I wonder if they are shooting themselves because they are aiming almost straight up to hit the player.
#3345 Posted 06 September 2023 - 09:24 PM
The thing is I’m no higher than I would be if I was up on the ledges in la rumble or other maps. I don’t recall them dying when I’m higher up than them like that in those situations. -34500 Z puts me about 2 stories high. That’s really not that high up.
#3346 Posted 06 September 2023 - 10:42 PM
In any case, you should be setting the player's posz in relation to the base of the mech, not the floorz. The mech could be standing on a sprite bridge, or there could be a sloped floor, or it could be falling or jumping, any of those situations would make your placement wrong.
#3347 Posted 07 September 2023 - 04:33 AM
Danukem, on 06 September 2023 - 10:42 PM, said:
In any case, you should be setting the player's posz in relation to the base of the mech, not the floorz. The mech could be standing on a sprite bridge, or there could be a sloped floor, or it could be falling or jumping, any of those situations would make your placement wrong.
Yeah I’m doing that now. I was already doing it that way for my tank and switched to that method for the mech too. Thanks
#3348 Posted 12 September 2023 - 10:44 AM
Something weird about the recon's sounds
still plays the sound
plays both RECO_ATTACK and PRED_PAIN
every battlelord in the game shows up
onevent EVENT_SOUND ifactor RECON ifactorsound THISACTOR RECO_ATTACK set RETURN -1 endevent
still plays the sound
ifactor RECON ifactorsound THISACTOR RECO_ATTACK set RETURN PRED_PAIN endevent
plays both RECO_ATTACK and PRED_PAIN
onevent EVENT_SOUND ifactor RECON ifactorsound THISACTOR RECO_ATTACK { set RETURN -1 spawn BOSS1 } endevent
every battlelord in the game shows up
#3349 Posted 12 September 2023 - 11:31 AM
Are u trying to stop the RECO_ATTACK sound from playing? Would stopsound work?
This post has been edited by VGames: 12 September 2023 - 11:32 AM
#3350 Posted 12 September 2023 - 12:55 PM
lllllllllllllll, on 12 September 2023 - 10:44 AM, said:
Something weird about the recon's sounds
still plays the sound
plays both RECO_ATTACK and PRED_PAIN
every battlelord in the game shows up
onevent EVENT_SOUND ifactor RECON ifactorsound THISACTOR RECO_ATTACK set RETURN -1 endevent
still plays the sound
ifactor RECON ifactorsound THISACTOR RECO_ATTACK set RETURN PRED_PAIN endevent
plays both RECO_ATTACK and PRED_PAIN
onevent EVENT_SOUND ifactor RECON ifactorsound THISACTOR RECO_ATTACK { set RETURN -1 spawn BOSS1 } endevent
every battlelord in the game shows up
From your description, a logical explanation would be that two copies of the sound are being played. One copy is an actor sound and another is a global sound or at least is not owned by the recon sprite.
#3352 Posted 12 September 2023 - 03:33 PM
Stopactorsound makes it sometimes play, sometimes play partway before cutting off.
I replaced the voc in RECO_ATTACK's entry with blank.voc
It's just I wonder why it fires so many times with each shot while at the same time won't null the sound.
The bit for spawning boss1 should be limited to only sounds played by the recon and only RECO_ATTACK. Do sounds played from hardcode at the same time mess with the event->RETURN order of things?
I replaced the voc in RECO_ATTACK's entry with blank.voc
It's just I wonder why it fires so many times with each shot while at the same time won't null the sound.
The bit for spawning boss1 should be limited to only sounds played by the recon and only RECO_ATTACK. Do sounds played from hardcode at the same time mess with the event->RETURN order of things?
#3353 Posted 12 September 2023 - 04:10 PM
Ok so I'm trying to get the number of babes saved and number of babes not saved to show up on the end of map screen where all the completed map stats are displayed. I got it all to work great and everything is aligned and shows up as it should according to the original pace that the original stats pop up. It looks great but I want the babes saved stats to show up immediately like all the other stats do when any button is pressed. No matter what I do the getinput bits stuff will not register correctly with EVENT_DISPLAYBONUSSCREEN. I must be doing something wrong, or it doesn't work that way in that event. When I search for inputs in EVENT_GAME using the exact same code for Buttons1 and Buttons2 seen below the babes saved stats show up immediately when the end of map screen is shown. There is no delay as there should be for those stats. I'd like to keep the getinput stuff in the EVENT_DISPLAYBONUSSCREEN. Please tell me what I'm doing wrong.
appendevent EVENT_DISPLAYBONUSSCREEN // ************************************************************************************ rotatesprite -29 100 35000 0 7164 0 0 4096 windowx1 windowy1 windowx2 windowy2 rotatesprite 347 100 35000 1024 7164 0 0 4100 windowx1 windowy1 windowx2 windowy2 ifvarn BABESDELAY 1000 { getinput[].bits Buttons1 getinput[].extbits Buttons2 ifvarand Buttons1 1 setvar BABESDELAY 1000 ifvarand Buttons2 1 setvar BABESDELAY 1000 ifvarl BABESDELAY 400 addvar BABESDELAY 1 ifvarge BABESDELAY 352 { screentext 2837 67 170 65536 0 0 192 0 0 4096 0 4 8 1 0 524290 0 0 xdim ydim screentext 2837 62 180 65536 0 0 193 0 0 4096 0 4 8 1 0 524290 0 0 xdim ydim } ifvare BABESDELAY 380 sound RPG_EXPLODE ifvarge BABESDELAY 385 { redefinequote 174 %d%d qsprintf 174 174 BABESSAVED screentext 2837 158 170 65536 0 0 174 0 0 4096 0 4 8 1 0 524290 0 0 xdim ydim redefinequote 174 %d%d qsprintf 174 174 BABESTOTAL screentext 2837 158 180 65536 0 0 174 0 0 4096 0 4 8 1 0 524290 0 0 xdim ydim } } else { screentext 2837 67 170 65536 0 0 192 0 0 4096 0 4 8 1 0 524290 0 0 xdim ydim screentext 2837 62 180 65536 0 0 193 0 0 4096 0 4 8 1 0 524290 0 0 xdim ydim sound RPG_EXPLODE redefinequote 174 %d%d qsprintf 174 174 BABESSAVED screentext 2837 158 170 65536 0 0 174 0 0 4096 0 4 8 1 0 524290 0 0 xdim ydim redefinequote 174 %d%d qsprintf 174 174 BABESTOTAL screentext 2837 158 180 65536 0 0 174 0 0 4096 0 4 8 1 0 524290 0 0 xdim ydim } endevent // ************************************************************************************
#3354 Posted 12 September 2023 - 05:42 PM
If you can't get button presses to work you might be able to do the opposite which is to keep increasing the delay of the babe stats messages while testing for changes to the stats screen indicating the player has pressed something. Then the babe stats appear when no further delay is being added.
#3355 Posted 12 September 2023 - 06:25 PM
lllllllllllllll, on 12 September 2023 - 05:42 PM, said:
If you can't get button presses to work you might be able to do the opposite which is to keep increasing the delay of the babe stats messages while testing for changes to the stats screen indicating the player has pressed something. Then the babe stats appear when no further delay is being added.
That’s a good idea. I can maybe detect the explosion sound that plays when all of the original stats are fully displayed when a button is pressed. I don’t think it just makes the rpg_explode sound.
#3356 Posted 21 September 2023 - 11:01 AM
I noticed that when duke is within a small number of sectors away from an enemy that their pathing suddenly becomes much sharper. Can this number be accessed for individual sprites?
I've been trying to make an invisible projectile become visible or visible projectiles become tempoarily invisible with no luck. Using cstat or .cstat or flags, doing it from event/eshoot/the projectile etc. it doesn't seem possible.
It is to hide the projectile appearing to spawn behind the actor when viewed from the side. Making it originate further forward causes it to shoot around obstructions that should be blocking the projectile and to miss targets at pointblank. When I use movesprite it is either colliding with the actor firing it or the first frame is always visually in the original spot before the shift occurs.
Because the tile art is leaning forward and the projectile has side views the offset is pretty big.
Setting it to switch to a new action after x ticks/actions/count/distance, or having a projectile shoot a projectile didn't work either.
I've been trying to make an invisible projectile become visible or visible projectiles become tempoarily invisible with no luck. Using cstat or .cstat or flags, doing it from event/eshoot/the projectile etc. it doesn't seem possible.
It is to hide the projectile appearing to spawn behind the actor when viewed from the side. Making it originate further forward causes it to shoot around obstructions that should be blocking the projectile and to miss targets at pointblank. When I use movesprite it is either colliding with the actor firing it or the first frame is always visually in the original spot before the shift occurs.
Because the tile art is leaning forward and the projectile has side views the offset is pretty big.
Setting it to switch to a new action after x ticks/actions/count/distance, or having a projectile shoot a projectile didn't work either.
#3357 Posted 21 September 2023 - 12:03 PM
You can turn it invisible in EVENT_EGS and then make it visible one tic later in EVENT_GAME. You should also be able to use defineprojectile and set cstat to 32768 in the definition and then set it to visible one tic later. I know with certainty that the first method works because I use it sometimes.
#3358 Posted 21 September 2023 - 03:12 PM
onevent EVENT_EGS ifactor myprojectile cstator 32768 endevent onevent EVENT_EGS ifactor myprojectile setactor[THISACTOR].cstat 32768 endevent onevent EVENT_EGS ifactor myprojectile setthisprojectile[THISACTOR].cstat 32768 endevent
tried these to make sure they don't work; the projectile is still visible
I'll combine it with event_game and movesprite in a bit to see if it magically erases the first frame.
The default cstat is 0 and the workslike is 32770.
#3359 Posted 21 September 2023 - 05:38 PM
EGS to set invisible projectile
GAME to unset invisible projectile
eshoot for movesprite on the projectile
The projectile itself is set to PROJ_VEL_MULT 24
GAME to unset invisible projectile
eshoot for movesprite on the projectile
The projectile itself is set to PROJ_VEL_MULT 24
onevent EVENT_GAME ifactor myprojectile { ife var4 1 { setthisprojectile[THISACTOR].cstat 32768 setav[THISACTOR].var4 0 } } endevent onevent EVENT_EGS ifactor myprojectile { setthisprojectile[THISACTOR].cstat 32768 setav[THISACTOR].var4 1 } endevent //actor code { eshoot myprojectile cos var1 sprite[RETURN].ang sin var2 sprite[RETURN].ang shiftr var1 3 shiftr var2 3 movesprite RETURN var1 var2 0 CLIPMASK0 var3 } //
#3360 Posted 22 September 2023 - 07:43 AM
In case of event_game running at tick 0 I tried this too
onevent EVENT_GAME ifactor myprojectile { ifl var4 2 { add var4 1 ife var4 2 setthisprojectile[THISACTOR].cstat 32768 } }