EDuke32 Scripting "CON coding help"
#3143 Posted 21 December 2022 - 03:12 PM
where sector 2 is tagged with SECRET AREA and sector 1 is not.
#3144 Posted 21 December 2022 - 06:10 PM
#3145 Posted 21 December 2022 - 10:44 PM
lllllllllllllll, on 21 December 2022 - 03:12 PM, said:
where sector 2 is tagged with SECRET AREA and sector 1 is not.
Tag BOTH sectors as secrets. Define a special sprite and add one copy of it to each tagged sector, and make the sprites share a lotag. Code the sprite to detect whether the player is entering its sector, when the player does have it look for the other sprite with the same lotag, if it finds it then untag the other sector.
#3146 Posted 22 December 2022 - 12:09 AM
I couldn't think of a way to use findsprite and ignore the closest instance of in favor of finding one with a particular lotag.
If I place a Trigger -> Respawn -> Sprite that sets its sector's Lotag to 0 and kills itself,
will I need to also detect and kill the Trigger in the other secret sector to prevent the secret sector duke just entered from being tinkered with later? Or is the game setting Lotag to 0 after tallying the secret anyway?
(both sectors tagged Secret, both sectors have a Trigger linked to the other's Respawn,,, duke enters sector 1 which spawns a sprite in sector 2 and strips sector 2's lotag, then duke enters sector 2 which in turn spawns a sprite that strips sector 1's lotag)
#3147 Posted 22 December 2022 - 12:19 AM
lllllllllllllll, on 21 December 2022 - 03:12 PM, said:
where sector 2 is tagged with SECRET AREA and sector 1 is not.
just only tag one sector as the actual secret area, not all of them, it will count every single sector with the tag as an individual secret area. so simply only tag one.
#3148 Posted 22 December 2022 - 12:54 AM
lllllllllllllll, on 22 December 2022 - 12:09 AM, said:
That should work. I was going to suggest a different method but it would have required you to learn some new stuff, so your method is better in that respect.
#3149 Posted 22 December 2022 - 01:48 PM
define SECRETSPOOF 9999
onevent EVENT_LOADACTOR
ifactor SECRETSPOOF
{
getactor[THISACTOR].lotag othersector
setactor[THISACTOR].lotag 0
getactor[THISACTOR].hitag duplicatesecrets
setactor[THISACTOR].hitag 0
}
endevent
onevent EVENT_SPAWN
ifactor SECRETSPOOF
{
getplayer[THISACTOR].max_secret_rooms secretstotal
subvarvar secretstotal duplicatesecrets
setplayer[THISACTOR].max_secret_rooms secretstotal
}
endevent
actor SECRETSPOOF
getsector[THISACTOR].lotag sectorlotag
ifvare sectorlotag 0
{
setsector[othersector].lotag 0
killit
}
enda
var othersector 0 2
var duplicatesecrets 0 2
var secretstotal 0 2
var sectorlotag 0 2
Usage:
No bugs after 20 seconds of rigorous testing
#3150 Posted 22 December 2022 - 07:24 PM
#3151 Posted 22 December 2022 - 08:40 PM
if (!A_CheckSpriteFlags(otherSprite, SFLAG_NODAMAGEPUSH))
{
if (pOther->xvel < 0) pOther->xvel = 0;
pOther->xvel += (pSprite->extra<<2);
}Note that any actor with the spriteflag NODAMAGEPUSH is immune to pushback.
"Pushback" may be a misnomer because obviously it pushes forward, not backwards. I don't think this is a bug, but rather it ensures the player can see the actor in front of the explosion sprite.
#3152 Posted 22 December 2022 - 08:59 PM
Reaper_Man, on 22 December 2022 - 08:40 PM, said:
I never considered that might be the reason for it. Instead I suspected that xvel was given the wrong sign and it was supposed to move the enemy backwards.
@Vgames: In AA what I do is multiply xvel by -1 at the moment of impact, and in addition some weapons have their own separate knockback effect. If you want the scripted knockback to be the only source, then you can set xvel to 0 at the moment of impact.
#3153 Posted 23 December 2022 - 01:12 AM
Danukem, on 22 December 2022 - 08:59 PM, said:
@Vgames: In AA what I do is multiply xvel by -1 at the moment of impact, and in addition some weapons have their own separate knockback effect. If you want the scripted knockback to be the only source, then you can set xvel to 0 at the moment of impact.
Thanks. I’ll give this a try
#3155 Posted 28 December 2022 - 03:57 PM
I've started with this;
action CALLON 1 1 1 1 1 // advance one frame
define CALLUP 5872
useractor notenemy CALLUP
{
ifn sprite[].lotag 0
geta[].lotag lotagsaved
}
enda
define CALLDN 5874
useractor notenemy CALLDN
{
ifn sprite[].lotag 0
geta[].lotag lotagsaved
}
enda
Although there are 2 actors, only one will be tagged at a time; the other untagged one will just be for decoration.
I'm not asking to be spoon-fed the answer, but will I need to manipulate a game event so that if the touchplate lotag equals the 'lotagsaved' variable then the action CALLON will run for a certain actioncount?
The art tiles:
This post has been edited by MC84: 28 December 2022 - 04:09 PM
#3156 Posted 28 December 2022 - 08:11 PM
case CALLUP
{ ifn sprite[].lotag 0 geta[].lotag lotagsaved }
break
case CALLDN
{ ifn sprite[].lotag 0 geta[].lotag lotagsaved }
break
case TOUCHPLATE
{ ife sprite[].lotag lotagsaved
{ set linked 1 } }
breakThen under the actor declaration I've put this;
action CALLON 1 1 1 1 50 // advance one frame
useractor notenemy CALLUP
{
cstat 80
ifaction CALLON
{
soundonce 35
ifactioncount 64
{
action ZERO
break
}
}
ife linked 0 nullop
else
ife linked 1
{
action CALLON
}
}
endaHowever, even if I remove the above actor code, it appears that just this statement on its own
case CALLUP
{ ifn sprite[].lotag 0 geta[].lotag lotagsaved }
breakcauses the actor CALLUP to disappear when the game runs... Maybe I'm trying to be too ambitious here but can anyone point out why this is occurring?
#3157 Posted 28 December 2022 - 08:26 PM
The exceptions to what I just wrote are the hardcoded effector sprites such as SE, RESPAWN, etc which were designed to have the tags left on them.
#3158 Posted 29 December 2022 - 11:29 AM
AVG antivirus does not really likes the latest Eduke32 and Mapster32 synthesis, they are seen as malware/virus, without even control if the files are false positives. Does not happen with Debug versions.
This post has been edited by Fantinaikos: 29 December 2022 - 11:31 AM
#3159 Posted 29 December 2022 - 05:28 PM
If it's any consolation, I once had my own antivirus trigger after running the eduke32.exe that I just had compiled seconds beforehand.
#3160 Posted 30 December 2022 - 05:22 PM
This post has been edited by MC84: 30 December 2022 - 05:26 PM
#3161 Posted 30 December 2022 - 08:17 PM
#3162 Posted 30 December 2022 - 09:17 PM
VGames, on 30 December 2022 - 08:17 PM, said:
use EVENT_GAME since it doesn't have actor status. In that event,
ifactor APLAYER
ife THISACTOR player[].holoduke_on
{
// put your holoduke code here
}
#3163 Posted 31 December 2022 - 12:41 AM
Setting the actor's shade once or multiple times does not work, nor does shadeto, presumably because it is taking the floor's shade/pal after.
So next to try is cstator noshade then set the shade to 0 or -127 and wait to remove noshade on the next tick. If taking off noshade makes the shade jump straight to the floor value instead of fading then 1 or 2 ticks of shadeto before.
Is there an existing command to brighten on shots (or invoke the hardcoded version for another sprite)?
#3164 Posted 31 December 2022 - 02:21 AM
EDIT: I've never used it before, but there is an htflag for hardcoded badguy. I have no idea whether it would cause the sprite to brighten upon firing.
This post has been edited by Danukem: 31 December 2022 - 03:12 AM
#3165 Posted 31 December 2022 - 09:51 AM
lllllllllllllll, on 31 December 2022 - 12:41 AM, said:
Setting the actor's shade once or multiple times does not work
What are you setting the shade to in your code? Setting the actor shade to -127 should illuminate them when they shoot the way hardcoded enemies illuminate. Like:
shoot SOMETHING seta .shade -127
That should be all it takes.
#3166 Posted 31 December 2022 - 10:21 AM
Setting it at spawn I don't see any side effects so far
Reaper_Man, on 31 December 2022 - 09:51 AM, said:
shoot SOMETHING seta .shade -127
That should be all it takes.
It doesn't visibly change
#3167 Posted 31 December 2022 - 12:51 PM
This post has been edited by jimbob: 31 December 2022 - 12:52 PM
#3168 Posted 31 December 2022 - 01:16 PM
lllllllllllllll, on 31 December 2022 - 10:21 AM, said:
Setting it at spawn I don't see any side effects so far
We are talking about the 262144 flag right?
#3169 Posted 31 December 2022 - 01:52 PM
This post has been edited by VGames: 31 December 2022 - 01:53 PM
#3170 Posted 31 December 2022 - 02:08 PM
Dunno when I need "or" I set the vars in such a way that 2 of the 3 values can be lumped together using >, <, and not=
#3171 Posted 31 December 2022 - 02:24 PM
VGames, on 31 December 2022 - 01:52 PM, said:
There really isn't, at least not for generically evaluating statements. You can however use ifor to evaluate pairs of values, providing that they are constants, vars, or specific struct members. For example:
ifor player[].heat_on player[].jetpack_on
al THISACTOR
That code will put the value of THISACTOR in the log when either the goggles are on or the jetpack is on. But the following will NOT compile:
ifor { ifg player[].htextra 0 } { ifg player[].shield_amount 0 } al THISACTOR
And removing the { } would change the meaning.
#3172 Posted 31 December 2022 - 02:32 PM
lllllllllllllll, on 31 December 2022 - 02:08 PM, said:
By the way, I don't understand why your enemies aren't already lighting up when they fire. Mine do automatically, and I have not added that flag to them. I do define them as enemy -- are you not doing that?

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


