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

Jump to content

  • 119 Pages +
  • « First
  • 113
  • 114
  • 115
  • 116
  • 117
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is online   VGames 

#3421

Isn't there a way to find the sprite number of a certain actor that relates to their number specified in the map editor? Like the number they are given upon spawning into a map or something like that. I could have sworn there was something for this, but I may be thinking of another game.
0

User is offline   Danukem 

  • Duke Plus Developer

#3422

Why would it matter if the sprite number in game is the same as the one in the editor?
0

User is online   VGames 

#3423

I have an actor that detects when other actors are near it using a list to single them out. But that actor is included in that list too so I need to figure out a way to separate it from the other actors that have the same picnum. So figured if I could get its actual sprite number that would separate it from the others completely. I thought there was something like this in eduke but I think I may have gotten it mixed up with Blood Fresh Supply. Is there an easier way to do this?
0

#3424

Is this list picnums or individual sprites? If it's sprites you just check if each in the list is equal to THISACTOR [the current sprite's id], a match meaning it's the same sprite.
Or if you are trying to get the individual sprites are you thinking of espawn? RETURN would be the sprite id.
0

User is offline   Danukem 

  • Duke Plus Developer

#3425

View Postlllllllllllllll, on 14 March 2024 - 11:39 AM, said:

Is this list picnums or individual sprites? If it's sprites you just check if each in the list is equal to THISACTOR [the current sprite's id], a match meaning it's the same sprite.
Or if you are trying to get the individual sprites are you thinking of espawn? RETURN would be the sprite id.


I guess he doesn't know how to loop through a list. He needs to use a while or for loop based on statnum or all the sprites in the map and then check distance to ones of the picnum to do whatever to them. Some relevent commands:

https://wiki.eduke32.../wiki/Whilevarn
https://wiki.eduke32.../Headspritestat
https://wiki.eduke32.com/wiki/Dist
0

User is online   VGames 

#3426

I know how to loop through a list, but I think I worded my problem wrong. And yes, its searching for picnums not just sprites. I'll refine my issue because I left out something:

I have an actor that detects when other actors are near it using a list of picnums to decide if it needs to react or not. This list consists of enemies, and the name of some of the enemies on the list create these actors. So, what I need to figure out: How do I keep the actor from reacting to one of these enemies in this list if they were the one that created it? I know how to use owner to figure out who spawned it but how do I keep the actor in question from not reacting to its enemy owner and at the same time react to an enemy who has the same picnum as its owner? I hope y'all can understand my question better.

This post has been edited by VGames: 14 March 2024 - 04:48 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#3427

I'm not really sure what you are trying to say there, but maybe you could have a per-actor var and then set it to a specific unique value for the originator and its lineage, then you can just check it.
0

User is online   VGames 

#3428

Oh that’s a good idea. I can have a random number generate and assign it to the owner then check for that. Thanks for the tip.
0

User is online   VGames 

#3429

Is it possible to manipulate console commands such as "r_glowmapping" via con code or can this only be turned on and off via the console or by editing the actual config files?
0

User is offline   Danukem 

  • Duke Plus Developer

#3430

No, I don't think so. I've wanted to do that myself. If it is possible, it's an undocumented feature.
1

User is online   VGames 

#3431

Ok thanks for the info. I figured it wasn't possible, but I had to ask.
0

User is offline   Mark 

#3432

I have some simple code that displays some partially transparent animated frames across the screen depending on if the player is underwater or under a parallaxed sky. The problem is I have some interior spaces with a windowed skylight in the ceiling and it triggers the effect and I don't want that. I was thinking I could change the pal or tag of just those sectors and then add conditions to the ifoutside command to exclude those sectors from triggering the effect. How would I do that? Or should I tackle this from a completely different way?

onevent EVENT_DISPLAYREST
ifactor APLAYER
ifinwater
{ rotatespritea 160 100 524288 0 3589 20 0 1024 160 0 0 xdim ydim soundonce DUKE_UNDERWATER }
else
ifoutside
rotatespritea 160 100 65536 0 8183 20 0 1024 220 0 0 xdim ydim
endevent
0

User is offline   Mark 

#3433

I came up with a possible solution shortly after posting. I'm pretty sure the indoor skylights are at a lower height than the outdoor skybox ceilings so I simply checked for ceiling height and if it was less than a certain number, don't do the rotatespritea command. I need to run thru the maps and verify the effect is indeed working under all outdoor sectors.

But if you have a simple solution like I mentioned in the previous post I will use that instead.

EDIT: There were a couple of minor areas in just one map where the effect didn't show outdoors with my ceiling height check solution but not a gamebreaker thing.

This post has been edited by Mark: 25 March 2024 - 06:50 AM

0

#3434

If the skylight is a single sector then check the sprites in the sector for the skylight whenever ifoutside is true and the player's sector has changed from the previous tick
0

User is offline   Danukem 

  • Duke Plus Developer

#3435

Also, most of the code should be in the APLAYER actor (or at least gameworld side), and that code should set a var that triggers drawing of the correct sprite in the display event. Then the display event just draws the sprite and isn't checking gameworld stuff.
0

User is online   VGames 

#3436

Has anybody ever noticed that the Duke Nukem 3D logo on the main menu gets moved down a few clicks when you activate the main menu while playing a map? Like before you load a map the logo sits in one place and then if you bring up the main menu by pressing ESC in game the logo has moved down a bit. Is this fixable or does this have to be fixed via the source?
0

User is offline   NightFright 

  • The Truth is in here

#3437

Is there a way to draw negative DIGITALNUM values?

I'm trying to get a frags display working for Dukematch. So far I got this:

var FRGS 0 2 
getp[].frag FRGS
sub FRGS player[].fraggedself
digitalnumber DIGITALNUM 160 183 FRGS 0 0 272 0 0 xdim ydim


Problem:
If player kills themselves when counter is 0, instead of a minus it shows an inventory icon (Steroids in this case).

I guess the problem is there is no minus sign for DIGITALNUM. If a custom one was made, is there a way to display it properly? Maybe digitalnumber also isn't the right approach. Possibly with screentext instead?
0

User is offline   Danukem 

  • Duke Plus Developer

#3438

View PostNightFright, on 27 March 2024 - 01:51 AM, said:

Is there a way to draw negative DIGITALNUM values?

I'm trying to get a frags display working for Dukematch. So far I got this:

getp[].frag FRGS
sub FRGS player[].fraggedself
digitalnumber DIGITALNUM 160 183 FRGS 0 0 272 0 0 xdim ydim


Problem:
If player kills themselves when counter is 0, instead of a minus it shows an inventory icon (Steroids in this case).

I guess the problem is there is no minus sign for DIGITALNUM. If a custom one was made, is there a way to display it properly? Maybe digitalnumber also isn't the right approach. Possibly with screentext instead?


Notice that in the regular font (define STARTALPHANUM 2822), the minus sign is 3 tiles before the 0, and in the DIGITALNUM tiles you are using, the steroids icon is 3 tiles before the 0. So the game believes the minus sign is supposed to be 3 tiles before the 0. If you just copy the DIGITALNUM tiles to new tile numbers and add your custom minus sign 3 tiles before the 0 and use the tile of your 0 in the digitalnumber command, it should work.
1

User is offline   NightFright 

  • The Truth is in here

#3439

Ah, that explains the Steroids. Thanks for the hint!
Got it working now, with this (custom "minus" sign loaded as tile #10000):

In definitions:
// Copy DIGITALNUM (2472) to tilerange 10003-10012
copytile 10003 { tile 2472 }
copytile 10004 { tile 2473 }
copytile 10005 { tile 2474 }
copytile 10006 { tile 2475 }
copytile 10007 { tile 2476 }
copytile 10008 { tile 2477 }
copytile 10009 { tile 2478 }
copytile 10010 { tile 2479 }
copytile 10011 { tile 2480 }
copytile 10012 { tile 2481 }


In CON:
define FRAGNUM 10003
getp[].frag FRGS
sub FRGS player[].fraggedself
digitalnumber FRAGNUM SHIFTX 183 FRGS 0 0 272 0 0 xdim ydim


Now still looking for a way to pull off statusbar scaling, as outlined here.
0

#3440

Anything that can be done about slimers in a normal sector crawling onto the player in an underwater sector being invisible and silent?
0

#3441

Is there a simple way to resize an actor? I'm trying to resize RECON to 56 48, with EVENT_EGS and EVENT_SPAWN, but the affect I get is spawning RECONS from all difficulty settings and they just stand still doing nothing.
0

#3442

If you change attributes of actors waiting to be deleted it stops the deletion. The frozen recons are the ones that were supposed to be removed due to skill setting but didn't get deleted because of the resizing.
To avoid messing with the to-be-deleted recons, check their size before you do anything to them. A sprite waiting to be deleted is going to be tiny. By making sure they are larger than 4x or 4y you can size just the relevant recons. But a RESPAWN'd sprite is going to start tiny too.

event_egs affects recons spawned by RESPAWN

event_loadactor affects recons placed on the map

event_spawn affects both recons placed on the map and spawned by RESPAWN


So you just need to check loadactor sizes and then apply the change there, and respawns in egs do not need to be checked before you modify them.
If you set the check in event_spawn it will process RESPAWNs but won't do anything to them since they are smaller than 4x 4y.
Just one or the other xrepeat or yrepeat needs to be checked.


Sometimes you'll find sprites that spawn tiny no matter what and you can use
ifle sprite[].lotag userdef[].player_skill
to check the skill setting directly


Or you can combine the two in event_spawn with something like
  ifactor RECON
  {
    ifspawnedby RESPAWN
      sizeat 56 48
    else
    ifle sprite[].lotag userdef[].player_skill
      sizeat 56 48
  }










mashed enter

This post has been edited by lllllllllllllll: 28 March 2024 - 07:36 PM

2

#3443

View Postlllllllllllllll, on 28 March 2024 - 07:29 PM, said:

If you change attributes of actors waiting to be deleted it stops the deletion. The frozen recons are the ones that were supposed to be removed due to skill setting but didn't get deleted because of the resizing.
To avoid messing with the to-be-deleted recons, check their size before you do anything to them. A sprite waiting to be deleted is going to be tiny. By making sure they are larger than 4x or 4y you can size just the relevant recons. But a RESPAWN'd sprite is going to start tiny too.

event_egs affects recons spawned by RESPAWN

event_loadactor affects recons placed on the map

event_spawn affects both recons placed on the map and spawned by RESPAWN


So you just need to check loadactor sizes and then apply the change there, and respawns in egs do not need to be checked before you modify them.
If you set the check in event_spawn it will process RESPAWNs but won't do anything to them since they are smaller than 4x 4y.
Just one or the other xrepeat or yrepeat needs to be checked.


Sometimes you'll find sprites that spawn tiny no matter what and you can use
ifle sprite[].lotag userdef[].player_skill
to check the skill setting directly


Or you can combine the two in event_spawn with something like
  ifactor RECON
  {
    ifspawnedby RESPAWN
      sizeat 56 48
    else
    ifle sprite[].lotag userdef[].player_skill
      sizeat 56 48
  }










mashed enter

Holy shit, wasn't expecting so many details on how to do it... Thank you so much!

EDIT: I ended up doing this, and it seems to work well
// Fixed RECON actor size
onevent EVENT_LOADACTOR
  switch sprite[].picnum
    case RECON
      sizeat 48 48
    break
  endswitch
endevent


One more thing... there is a bug that is getting me crazy and I want to fix it. Sometimes, the Sentry version of the bosses just don't die, they get in a kind of stuck state, facing the same direction and shooting at me, and they don't die. What is causing this?

This post has been edited by NukeDukem89: 29 March 2024 - 03:26 AM

0

#3444

Stuck like they are walking in some random direction instead of toward you? Or stuck like a loop?

The former usually happens when a useractor has its strength set to 0 with "strength 0". I guess if you have custom actions it could happen with the regular enemies. You can fix that by using "strength 1" instead.
The latter can happen when you have your "ifhitweapon" or its death states split from the shoot state in a manner where they will never be used. For example the flinch action is always in front of the other behavior states and joined with "else" so that only one or the other gets used, but ifhitweapon is still separate.
0

#3445

View Postlllllllllllllll, on 29 March 2024 - 06:23 AM, said:

Stuck like they are walking in some random direction instead of toward you? Or stuck like a loop?

The former usually happens when a useractor has its strength set to 0 with "strength 0". I guess if you have custom actions it could happen with the regular enemies. You can fix that by using "strength 1" instead.
The latter can happen when you have your "ifhitweapon" or its death states split from the shoot state in a manner where they will never be used. For example the flinch action is always in front of the other behavior states and joined with "else" so that only one or the other gets used, but ifhitweapon is still separate.

They are stuck in a random direction, stand still but like walking, and also shooting in the same direction. It's the World Tour code, nothing touched.

This post has been edited by NukeDukem89: 29 March 2024 - 06:59 AM

0

#3446

Sounds like "move 0".
I don't use world tour though. Does it happen with a clean con?
0

#3447

View Postlllllllllllllll, on 29 March 2024 - 09:49 AM, said:

Sounds like "move 0".
I don't use world tour though. Does it happen with a clean con?

I've tried to reproduce it without success... Weird taking into account that I came across this bug 3 or 4 times the other day...

I have more questions though. What exactly the spriteflag 8192 does? Smooth anims? If I put these spriteflags on TANK and NEWBEAST, they wake up as soon as the map is loaded. I don't understand. Is this spriteflag in any of the other enemies?

Talking about TANK and NEWBEAST, I'm seeing a attributes fix in many mods. It seems that these actors get oversized when loaded, but I haven't saw it in my playthroughs. Is there any exact place wheare I can see this?

This post has been edited by NukeDukem89: 29 March 2024 - 05:56 PM

0

User is offline   Danukem 

  • Duke Plus Developer

#3448

View PostNukeDukem89, on 29 March 2024 - 05:53 PM, said:

I've tried to reproduce it without success... Weird taking into account that I came across this bug 3 or 4 times the other day...

I have more questions though. What exactly the spriteflag 8192 does? Smooth anims? If I put these spriteflags on TANK and NEWBEAST, they wake up as soon as the map is loaded. I don't understand. Is this spriteflag in any of the other enemies?

Talking about TANK and NEWBEAST, I'm seeing a attributes fix in many mods. It seems that these actors get oversized when loaded, but I haven't saw it in my playthroughs. Is there any exact place wheare I can see this?


They are declared as "useractor" which makes them wake up on map load. That behavior should not be related to spriteflags 8192. That flag causes sprites to use movement interpolation which will make their movement (not animation) appear smooth when the framerate is higher than 30. However, I believe that flag is already on by default in recent EDuke32, so be careful if you set that, since you might be reversing it and turning it off by mistake.
0

#3449

View PostDanukem, on 29 March 2024 - 06:15 PM, said:

They are declared as "useractor" which makes them wake up on map load. That behavior should not be related to spriteflags 8192. That flag causes sprites to use movement interpolation which will make their movement (not animation) appear smooth when the framerate is higher than 30. However, I believe that flag is already on by default in recent EDuke32, so be careful if you set that, since you might be reversing it and turning it off by mistake.

I swear this lines
// Added smooth movement flag to TANK, DRONE and NEWBEAST
//spriteflags DRONE 8192
//spriteflags NEWBEAST 8192
//spriteflags TANK 8192

are causing these monsters to wake up on map load. I commented them and they don't wake up. I got them from your Essentials CON file btw, thanks again.

Maybe is causing the monsters to wake up because in fact it is already on by thefault on EDuke32 (https://voidpoint.io...4de595959a33c5b)?
0

User is offline   Danukem 

  • Duke Plus Developer

#3450

spriteflags 8192 is smoothmove, it is not supposed to make anything wake up

https://wiki.eduke32.com/wiki/Htflags

That change you linked in the source is only supposed to affect vertical movement, whereas smoothmove affects all movement. Nevertheless I do remember that enemies have smoothmove by default now. In fact it caused a problem for me in AA because I was applying the flag and enemies became stuttery after a certain revision. I figured out I was xoring the flag on them (https://wiki.eduke32...iki/Spriteflags)

But if the enemies are awake on start when the flag is set but not otherwise, that's pretty strange
0

Share this topic:


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