EDuke32 Scripting "CON coding help"
#3409 Posted 30 December 2023 - 07:23 PM
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
#3410 Posted 30 December 2023 - 07:29 PM
Mark, on 30 December 2023 - 07:23 PM, said:
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.
#3411 Posted 30 December 2023 - 07:41 PM
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
#3412 Posted 30 December 2023 - 07:50 PM
Mark, on 30 December 2023 - 07:41 PM, said:
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
#3413 Posted 06 January 2024 - 09:16 PM
#3414 Posted 01 February 2024 - 07:03 PM
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?
#3417 Posted 05 February 2024 - 01:11 PM
#3418 Posted 23 February 2024 - 05:11 PM
This post has been edited by VGames: 23 February 2024 - 05:13 PM
#3419 Posted 23 February 2024 - 08:54 PM
// 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.
#3420 Posted 24 February 2024 - 11:54 AM
#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.

Help
Duke4.net
DNF #1
Duke 3D #1


