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

Jump to content

  • 119 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 online   Danukem 

  • Duke Plus Developer

#3361

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

#3362

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

#3363

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 

#3364

Set the player X y and z velocity to 0
1

#3365

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

#3366

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

#3367

 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

#3368

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

User is offline   Mark 

#3369

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

User is online   Danukem 

  • Duke Plus Developer

#3370

View PostMark, 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

  #3371

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

User is offline   Mark 

#3372

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

#3373

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 

#3374

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

#3375

View PostMark, 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 

#3376

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

#3377

View PostMark, 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 

#3378

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

#3379

 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 

#3380

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

#3381

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

#3382

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

#3383

Thanks for the quick reply, it works!

And Merry Christmas! :D
1

User is offline   Mark 

#3384

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

#3385

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 

#3386

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

#3387

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 

#3388

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

#3389

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 

#3390

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

Share this topic:


  • 119 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