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

Jump to content

  • 120 Pages +
  • « First
  • 111
  • 112
  • 113
  • 114
  • 115
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   VGames 

#3361

 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 

#3362

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

#3363

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 

#3364

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

#3365

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

User is offline   VGames 

#3366

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

#3367

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 

#3368

 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
0

#3369

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 

#3370

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

#3371

 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 

#3372

@ Danukem - check your PM's
0

#3373

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 

#3374

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

#3375

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 

#3376

 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

#3377

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

#3378

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

#3379

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

#3380

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

#3381

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

User is online   Danukem 

  • Duke Plus Developer

#3382

Did you try making the projectile's default cstat 32768?
0

#3383

Yeah
If it starts with 32768 it's staying invisible
If it starts with 0 it's staying visible
0

#3384

I wonder what's the way to suppress player movement from controller/gamepad, movement_lock only stops player movement from keyboard, indeed, as the wiki states.
I dunno if it's a trick about some player member i'm not aware of, or it's done by manipulating extbits or stuff like that. For sure I saw controller movement is turned off when in-game menus/datapads are on in AA or AMC iirc, but i have no clue on how to search for the solution.

This post has been edited by RichardStorm: 25 September 2023 - 01:37 AM

0

User is offline   VGames 

#3385

Set the player X y and z velocity to 0
1

#3386

I thought the same solution at the beginning (very simple indeed), but I was not sure about being in a menu while on conveyors etc... then i just veryfied and yes, the player gets totally locked. Going to zero posxv/posyv
0

#3387

Hmmm... Apparently, even if setting posxv and posyv to 0, the player still retains a bit of movement from controller. I tried setting posxv/posyv into APLAYER / EVENT_GAME, then into EVENT_WORLD, EVENT_PREWORLD, and even EVENT_PROCESSINPUT with no positive results (I also tried xvel/yvel but is long known it doesn't work that way). I wonder what i don't know or what am I doing wrong.
0

User is online   Danukem 

  • Duke Plus Developer

#3388

 RichardStorm, on 26 September 2023 - 07:15 AM, said:

Hmmm... Apparently, even if setting posxv and posyv to 0, the player still retains a bit of movement from controller. I tried setting posxv/posyv into APLAYER / EVENT_GAME, then into EVENT_WORLD, EVENT_PREWORLD, and even EVENT_PROCESSINPUT with no positive results (I also tried xvel/yvel but is long known it doesn't work that way). I wonder what i don't know or what am I doing wrong.


Yep, I was going to say something but you guys seemed happy with the solution so I stayed quiet.

The actual solution is to set the fvel and svel members of the input struct to 0 in EVENT_PROCESSINPUT:

https://wiki.eduke32...ructure_members
2

#3389

Now it works properly, many thanks Dan. :pray:
0

User is offline   Mark 

#3390

I'm working on a ( polymer ) project with a lot of candles, sconces and flames. I am using the flickering lights code portion of High Treason's CONFETTI mod and its OK. It flickers by randomly changing the radius of the light cast. However, I would like to see how well the flickering effect would work by changing the light's intensity instead of radius. The code would allow me to set the minimum and maximum intensities along with the rate of change.

Is there anyone out here who would like to tackle this request? I could Paypal you some pizza money for the effort.

This post has been edited by Mark: 05 October 2023 - 09:36 AM

0

Share this topic:


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