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

Jump to content

  • 119 Pages +
  • « First
  • 110
  • 111
  • 112
  • 113
  • 114
  • 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

#3331

https://wiki.eduke32...wiki/Weapon_pos
1

User is offline   VGames 

#3332

 Danukem, on 17 July 2023 - 11:29 AM, said:



Thanks a lot. That was a big help.
0

User is offline   zazo 

#3333

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
0

User is online   Danukem 

  • Duke Plus Developer

#3334

 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


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.
0

User is offline   VGames 

#3335

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.
0

User is offline   Radar 

  • King of SOVL

#3336

Hard.
0

User is offline   VGames 

#3337

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.
0

User is offline   Aleks 

#3338

 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.
0

User is online   Danukem 

  • Duke Plus Developer

#3339

 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.
0

User is offline   VGames 

#3340

 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.


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.
0

User is offline   VGames 

#3341

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?
0

User is online   Danukem 

  • Duke Plus Developer

#3342

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
1

User is offline   VGames 

#3343

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.

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

0

User is online   Danukem 

  • Duke Plus Developer

#3344

I wonder if they are shooting themselves because they are aiming almost straight up to hit the player.
0

User is offline   VGames 

#3345

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.
0

User is online   Danukem 

  • Duke Plus Developer

#3346

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.
0

User is offline   VGames 

#3347

View PostDanukem, 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
0

#3348

Something weird about the recon's sounds
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
0

User is offline   VGames 

#3349

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

0

User is online   Danukem 

  • Duke Plus Developer

#3350

 lllllllllllllll, on 12 September 2023 - 10:44 AM, said:

Something weird about the recon's sounds
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.
0

User is offline   VGames 

#3351

@ Danukem - check your PM's
0

#3352

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?
0

User is offline   VGames 

#3353

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 // ************************************************************************************


0

#3354

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.
0

User is offline   VGames 

#3355

 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.
0

#3356

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.
0

User is online   Danukem 

  • Duke Plus Developer

#3357

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.
0

#3358

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.
0

#3359

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

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
  }
//


Attached Image: capn.jpg
0

#3360

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
    }
  }

0

Share this topic:


  • 119 Pages +
  • « First
  • 110
  • 111
  • 112
  • 113
  • 114
  • 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