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

Jump to content

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

#3391

 Mark, on 05 October 2023 - 07:45 AM, said:

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.


So what is it that you want changed on the light exactly that isn't the radius? Because IIRC polymer doesn't specifically have an intensity value that is independent of the radius.

This post has been edited by Danukem: 05 October 2023 - 12:28 PM

0

User is offline   Hendricks266 

  • Weaponized Autism

  #3392

Lights use additive blending, so scale your RGB down linearly to achieve a reduction in intensity.
1

User is offline   Mark 

#3393

Before trying to figure out how to mess with intensity I decided to try and figure out what was the specific issue I had with my present code. I determined the problem was the randvarvar command was spitting out random numbers for light radius between 0 and the hitag for the sprite. Going so low was giving me too much flicker variation. So I used the addvar command to add a value to whatever comes out of randvarvar so it never approaches 0. After tweaking various parameters for the lights I have close to what I wanted.

I'm guessing curiosity might eventually make me pursue the intensity option ( I'll likely need help with that ) but for now I'll enjoy what I managed to do.

This post has been edited by Mark: 06 October 2023 - 10:52 AM

0

User is online   Danukem 

  • Duke Plus Developer

#3394

Yeah for a candle start with a base value then add the random flicker since the flame is never completely out. The alternative method Hendricks266 outlined in that discord post might work well too or better in some ways, probably worth experimenting with.
0

User is offline   Mark 

#3395

Can anyone send me in the direction of a previous mod's code that implemented fullscreen title and menu graphics as opposed to the usual square box? If not, is it something easy enough to post here? I haven't done a lot of coding in the last 6 months so my already limited knowledge is rusty. I was dazed and confused looking thru the wiki.
0

User is online   Danukem 

  • Duke Plus Developer

#3396

 Mark, on 24 November 2023 - 08:42 PM, said:

Can anyone send me in the direction of a previous mod's code that implemented fullscreen title and menu graphics as opposed to the usual square box? If not, is it something easy enough to post here? I haven't done a lot of coding in the last 6 months so my already limited knowledge is rusty. I was dazed and confused looking thru the wiki.


I'm not sure what you are asking. It sounds like you want widescreen to be the default, but what do you want to happen if the player has a non-widescreen resolution?
0

User is offline   Mark 

#3397

I didn't give it much thought. I'm assuming that anyone that might play my style of mod will normally be a widescreen user. Polymer, 3d models, high res graphics. Plus its just the backround screen textures I would want to be fullscreen. The center aligned menu text could remain as-is if thats possible. So if someone were to play in a different res all they would miss is the outer edges of the backround screens. This isn't a must have feature but I thought I would throw it in if it isn't too difficult to implement.
0

User is online   Danukem 

  • Duke Plus Developer

#3398

 Mark, on 25 November 2023 - 05:53 AM, said:

I didn't give it much thought. I'm assuming that anyone that might play my style of mod will normally be a widescreen user. Polymer, 3d models, high res graphics. Plus its just the backround screen textures I would want to be fullscreen. The center aligned menu text could remain as-is if thats possible. So if someone were to play in a different res all they would miss is the outer edges of the backround screens. This isn't a must have feature but I thought I would throw it in if it isn't too difficult to implement.


Are the tiles in question already being displayed in your project? I can only guess that you have put them in to replace the tiles in the hardcoded display. Is that correct? If that's the case then what you want to do is cancel the hardcoded display events and use your own screen drawing commands to display your own tiles.
0

User is offline   jimbob 

#3399

would it be possible to hack the camera/viewscreen code to use for a small cutscene ( say peeking through a crack like thing so you "see" the other side, and throw the player out at a certain command? ) or would another method be easier, in the end i want it to be triggerable just once, maybe have the player seeing "nah, i've seen enough" or something once its done.
0

User is online   Danukem 

  • Duke Plus Developer

#3400

 jimbob, on 27 November 2023 - 02:00 PM, said:

would it be possible to hack the camera/viewscreen code to use for a small cutscene ( say peeking through a crack like thing so you "see" the other side, and throw the player out at a certain command? ) or would another method be easier, in the end i want it to be triggerable just once, maybe have the player seeing "nah, i've seen enough" or something once its done.


Make a tile with a keyhole shape cutout or whatever, then you overlay that on the screen in the display event and set the camera position and angle to where you want it, lock the player in place and set up the trigger for unlocking the player and teleporting them. The good news for you is that several released mods have cutscenes like this and more elaborate ones.
0

User is offline   jimbob 

#3401

sounds easy enough, i'll mess around with that, thanks
0

#3402

Hey.

I'm using the following code to have debris and gibs land on the ground and stay there.


state getfloordist
  getactor[THISACTOR].x x
  getactor[THISACTOR].y y
  updatesector x y TEMP7
  getflorzofslope TEMP7 x y z
  getactor[THISACTOR].z TEMP8
  subvarvar z TEMP8
  shiftvarr z 8
  subvar z 1
ends


Unfortunately, each time a gib flies out of map bounds, this line appears in the log:

ERROR| game.con:801: getflorzofslope: invalid sector -1


After an hour of playtime the log might be a couple of megs large due to this and weird stuff starts to happen. How do I fix this?
Thanks in advance.
0

User is online   Danukem 

  • Duke Plus Developer

#3403

Merry Christmas!

state getfloordist
  getactor[THISACTOR].x x
  getactor[THISACTOR].y y
  updatesector x y TEMP7
  ifvare TEMP7 -1 { killit break }
  getflorzofslope TEMP7 x y z
  getactor[THISACTOR].z TEMP8
  subvarvar z TEMP8
  shiftvarr z 8
  subvar z 1
ends


I'm not sure if that fixes it because the issue could be happening further downstream in code that you didn't show. But the concept is simple enough -- do not allow the jibs to persist when out of bounds!
1

#3404

Thanks for the quick reply, it works!

And Merry Christmas! :D
1

User is offline   Mark 

#3405

I'm adding 3d model hub weapons in my polymer mod. I was able to disable the global screen flash when firing weapons but the hud model itself still goes a brighter shade when firing. How would I disable that effect?

I also noticed that after spending a lot of trial and error time getting all the hud offsets the way I wanted, the position shifted when I added the nobob command. I can deal with it but just thought I'd mention it in case others plan to use the nobob. Apply it before you start adjusting position.

This post has been edited by Mark: 30 December 2023 - 08:06 AM

0

User is online   Danukem 

  • Duke Plus Developer

#3406

View PostMark, on 30 December 2023 - 07:48 AM, said:

I'm adding 3d model hub weapons in my polymer mod. I was able to disable the global screen flash when firing weapons but the hud model itself still goes a brighter shade when firing. How would I disable that effect?

I also noticed that after spending a lot of trial and error time getting all the hud offsets the way I wanted, the position shifted when I added the nobob command. I can deal with it but just thought I'd mention it in case others plan to use the nobob. Apply it before you start adjusting position.


You have to be using CON code to display the weapon. If you are just overwriting the hardcoded tiles with your models, then they will inherit the hardcoded display features such as using a bright shade when firing.

If you are already using code for the display, then you just need to find where the shade is being set and make the edit so it doesn't brighten when firing.
1

User is offline   Mark 

#3407

Thanks. I guess I can live with it. Its not a huge thing like the global flash was. Coding weapons from scratch is beyong my skills. It was my hope some event could intercept and cancel the shade change.
0

User is online   Danukem 

  • Duke Plus Developer

#3408

View PostMark, on 30 December 2023 - 06:32 PM, said:

Thanks. I guess I can live with it. Its not a huge thing like the global flash was. Coding weapons from scratch is beyong my skills. It was my hope some event could intercept and cancel the shade change.


I'm assuming you already applied the WEAPON_NOVISIBLE flag to each weapon which is why they don't flash the level. If that's the case then I don't know what you could do besides having your own display code for them.

https://wiki.eduke32...i/WEAPONx_FLAGS

If you really are just using the hardcoded display with your own models, then one easy solution would be to include the weapon.sample.con included with EDuke32, then comment out the lines that set hud_shade to negative values.
0

User is offline   Mark 

#3409

I'll look into that.

I never saw that command when browsing the wiki. I used an old probably outdated method that I used since way back in my Graveyard project. IIRC I spotted it in someone's post and added to my list of con code snippets.

// remove all flash from weapon fire

onevent EVENT_RESETWEAPONS
// pistol
setvarvar gs WEAPON1_FLAGS
setvarvar gs WEAPON2_FLAGS
orvar gs 256
setvarvar WEAPON1_FLAGS gs
setvarvar WEAPON2_FLAGS gs
endevent

This post has been edited by Mark: 30 December 2023 - 07:24 PM

0

User is online   Danukem 

  • Duke Plus Developer

#3410

View PostMark, on 30 December 2023 - 07:23 PM, said:

I'll look into that.

I never saw that command when browsing the wiki. I used an old probably outdated method that I used since way back in my Graveyard project. IIRC I spotted it in someone's post and added to my list of con code snippets.

// remove all flash from weapon fire

onevent EVENT_RESETWEAPONS
// pistol
setvarvar gs WEAPON1_FLAGS
setvarvar gs WEAPON2_FLAGS
orvar gs 256
setvarvar WEAPON1_FLAGS gs
setvarvar WEAPON2_FLAGS gs
endevent


^ That code adds the flag that I was talking about. Although the code you posted only adds it to the pistol and shotgun. It's somewhat defective however since it sets the pistol to have all the same flags as the shotgun, which it's not supposed to.
0

User is offline   Mark 

#3411

I looked at the sample.con file and even if I delete sections for weapons I'm not going to use its still pretty daunting for me to make use of. I'll probably just change my code to the weapon flag that you mention.

Unless you think I can just drop that code in and it will use my existing models. Then all I have to do is look into the shade changing. My uneducated guess is its not that simple

This post has been edited by Mark: 30 December 2023 - 07:46 PM

0

User is online   Danukem 

  • Duke Plus Developer

#3412

View PostMark, on 30 December 2023 - 07:41 PM, said:

I looked at the sample.con file and even if I delete sections for weapons I'm not going to use its still pretty daunting for me to make use of. I'll probably just change my code to the weapon flag that you mention.

Unless you think I can just drop that code in and it will use my existing models. Then all I have to do is look into the shade changing.


Check your discord DMs
0

#3413

Have you ever gotten a custom sound to work with one-time ambient? For the SFX you usually hear when you walk outdoors on an E1 or E3 map like a heli or a jet flying over.
0

User is offline   VGames 

#3414

When using an ifspawnedby statement is there a way to check what action the actor is using that did the spawning? Like something like this:

	

ifactor NEWSHOTGUN
{
	ifspawnedby PIGCOP
	{
		geta[THISACTOR].owner myspawner

		ife sprite[myspawner].action APIGDIVESHOOT // SOMETHING LIKE THIS?
		{
			geta[].z z
			add z 5000
			seta[].z z
		}
	}
}




Is there something that can do this or no?
0

User is online   Danukem 

  • Duke Plus Developer

#3415

No, but there are plenty of other solutions.
0

User is offline   VGames 

#3416

Ok thanks
0

#3417

That trouble I was having with toggling projectile invisibility was from trying to set cstats arbitrarily instead of OR/XOR'ing them in. Same thing with finding differences between angles instead of using incangle.
0

User is offline   VGames 

#3418

Is there a way to detect whether or not a sector's shade is being manipulated by a SECTOREFFECTOR with a lotag of 3 or 4 via the player's scripts? That's that random lights effect. I was hoping there would be a floorstat or something like that that could be used to check it but there is not. I tried doing a findnearactor to see if the player was near a sectoreffector and if they were in the same sector but the findnearactor command does not work for sectoreffectors kind of like the EXPLOSION2 actor.

This post has been edited by VGames: 23 February 2024 - 05:13 PM

0

User is online   Danukem 

  • Duke Plus Developer

#3419

This isn't a direct answer, but you can find a SECTOREFFECTOR in a sector using other methods. findnearactor will not work (since it is not an actor), but findnearsprite will work. Better, if you are searching by sector and not distance, you can use code like this:

// lotag 24 SE in sector == conveyer belt
	
	set A NO
	headspritesect spriteid sprite[].sectnum
	whilevarn spriteid -1
	{
		ife sprite[spriteid].picnum SECTOREFFECTOR
		ife sprite[spriteid].lotag 24 set A YES
		nextspritesect spriteid spriteid
	}


That is some code I wrote for Duke Forces which detects whether there is a conveyer belt in the same sector as the sprite running the code and sets the var A to 1 if there is.
0

User is offline   VGames 

#3420

Oh that’s nice. Much better for sure than using distance for a search. And thanks for the tip on findnearsprite. That’ll come in handy down the road. Thanks.
0

Share this topic:


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