EDuke32 Scripting "CON coding help"
#3421 Posted 13 March 2024 - 01:30 PM
#3422 Posted 14 March 2024 - 12:14 AM
#3423 Posted 14 March 2024 - 04:39 AM
#3424 Posted 14 March 2024 - 11:39 AM
Or if you are trying to get the individual sprites are you thinking of espawn? RETURN would be the sprite id.
#3425 Posted 14 March 2024 - 11:49 AM
lllllllllllllll, on 14 March 2024 - 11:39 AM, said:
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
#3426 Posted 14 March 2024 - 04:46 PM
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
#3427 Posted 14 March 2024 - 10:25 PM
#3428 Posted 15 March 2024 - 04:59 AM
#3429 Posted 24 March 2024 - 11:07 AM
#3430 Posted 24 March 2024 - 01:20 PM
#3431 Posted 24 March 2024 - 01:23 PM
#3432 Posted 25 March 2024 - 05:18 AM
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
#3433 Posted 25 March 2024 - 06:29 AM
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
#3434 Posted 25 March 2024 - 11:43 AM
#3435 Posted 25 March 2024 - 12:43 PM
#3436 Posted 26 March 2024 - 04:00 PM
#3437 Posted 27 March 2024 - 01:51 AM
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?
#3438 Posted 27 March 2024 - 02:14 AM
NightFright, on 27 March 2024 - 01:51 AM, said:
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.
#3439 Posted 27 March 2024 - 03:44 AM
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.
#3440 Posted 28 March 2024 - 06:13 PM
#3441 Posted 28 March 2024 - 06:40 PM
#3442 Posted 28 March 2024 - 07:29 PM
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
#3443 Posted 29 March 2024 - 02:34 AM
lllllllllllllll, on 28 March 2024 - 07:29 PM, said:
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
#3444 Posted 29 March 2024 - 06:23 AM
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.
#3445 Posted 29 March 2024 - 06:58 AM
lllllllllllllll, on 29 March 2024 - 06:23 AM, said:
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
#3446 Posted 29 March 2024 - 09:49 AM
I don't use world tour though. Does it happen with a clean con?
#3447 Posted 29 March 2024 - 05:53 PM
lllllllllllllll, on 29 March 2024 - 09:49 AM, said:
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
#3448 Posted 29 March 2024 - 06:15 PM
NukeDukem89, on 29 March 2024 - 05:53 PM, said:
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.
#3449 Posted 30 March 2024 - 02:09 AM
Danukem, on 29 March 2024 - 06:15 PM, said:
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)?
#3450 Posted 30 March 2024 - 03:00 AM
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