
EDuke32 Scripting "CON coding help"
#1277 Posted 30 April 2013 - 03:07 PM
#1278 Posted 01 May 2013 - 07:45 AM
So I guess it's working in an optimal way now. Thanks guys!
#1279 Posted 01 May 2013 - 10:19 AM
Fox, on 26 April 2013 - 03:59 PM, said:
include this line somewhere before your actor code...
gamevar TEMP 0 2
Where you see the command "fall" in your actor, replace with:
ifvare sector[THISACTOR].lotag 1 { iffloordistl 8 setactor[THISACTOR].zvel 0 getsector[THISACTOR].lotag TEMP setsector[THISACTOR].lotag 0 fall setsector[THISACTOR].lotag TEMP } else fall
The proposed hack is pretty good, but the advice to copy-paste a dozen of lines of code is not. One should always aim at reducing redundancy. In this particular case, it's easy: just put these lines into a CON state.
Trooper Dan, on 26 April 2013 - 10:58 PM, said:
These two refer to different aspects of water: Fox's hack would prevent wading in water and your proposal would stop teleporting the actor. I haven't tested either of them, though.
#1280 Posted 01 May 2013 - 06:48 PM
onevent EVENT_GAME setprojectile[KNEE].extra 100 endevent
Why?
#1281 Posted 01 May 2013 - 06:56 PM
#1282 Posted 01 May 2013 - 09:45 PM
Fox, on 01 May 2013 - 06:56 PM, said:
Correct, but he can mod it the old fashioned way.
In USER.CON, find:
define KNEE_WEAPON_STRENGTH 10
and change the value to 100
#1283 Posted 02 May 2013 - 12:03 PM
Trooper Dan, on 01 May 2013 - 09:45 PM, said:
In USER.CON, find:
define KNEE_WEAPON_STRENGTH 10
and change the value to 100
That isn't desirable because my mod is a collection of mutators. In the end, I just defined a new projectile.
#1284 Posted 02 May 2013 - 12:34 PM
actor KNEE <strength> enda
Of course an alternative is to redefine the KNEE using defineprojectile, but that way it would loose some hard-coded features, such as increasing the strength if you are using Steroids.
#1285 Posted 16 May 2013 - 12:00 AM
ifvare PERSONEL_RESEARCH[8] 2 // player has thermal weaving? reduce damage by 20% { setvarvar TEMP7 TEMP8 mulvar TEMP7 10 subvarvar TEMP7 TEMP8 subvarvar TEMP7 TEMP8 divvar TEMP7 10 setvarvar TEMP8 TEMP7 }
That should reduce it by 20% right?
#1286 Posted 16 May 2013 - 06:18 AM
#1287 Posted 16 May 2013 - 06:31 AM
#1289 Posted 16 May 2013 - 06:01 PM
So to add 20% you'd do X = (5 * 120) / 100
#1290 Posted 24 May 2013 - 08:57 AM
What bit 1024 is likely supposed to do is to prevent resetting the gamevar's value to the default/initial one on various occasions such as starting a new game. For global and per-player gamevars, it could be e.g. used to hold information about gained mod-wide achievements.[1] However, currently, the value of such gamevars would still be (always) restored by savegames or (if NORESET is clear) when restoring mapstates.
While I'm not sure whether to call it a bug (there was never a specification), I still think it's not the desired behavior. Suppose you kill the final boss and win $ 106 as an award, but because you liked the final fight so much, you load up the last savegame and attempt to beat it once more. This time, you fail though, and all your money is lost

What I intend to do in LunaCON is to make NODEFAULT gamevars persist during the entire duration of a session, with the only option of restoring it being via readgamevar. (I'm not yet sure how the interaction with NORESET should be.) Because this is an externally visible change to gamevar behavior, I'll probably also backport it to C-CON. Are there any objections to this plan? It should be noted that in all the mods that I'm batch-testing CON-compilation on, there are only a total of four uses of that bit.
----------
[1]For per-actor gamevars, it has a somewhat technical use, the original one being rather meaningless. It can be set to prevent actor variables being reset on spawn (this includes the initial one from premap), so that they can be manipulated before: e.g. from eventloadactor code.
#1291 Posted 24 May 2013 - 11:50 AM
#1292 Posted 25 May 2013 - 05:54 AM
Fox, on 24 May 2013 - 11:50 AM, said:
They're not part of the official API and thus off-limits to users. LunaCON will disallow setting them unless we specify the meaning of each one clearly and unambiguously. No more guessing and half-baked workarounds!
[Edit: it's not my intent to criticize anyone's work, but I hope it's clear that exposing functionality that is not 100% understood is just a dead end.]
#1293 Posted 30 May 2013 - 02:30 AM
another command to set a "hit radius" for a melee weapon ? the defineprojectile xxx PROJ_RANGE seems to set the depth but not a radius around the player...
#1294 Posted 30 May 2013 - 11:54 PM
setactor[THISACTOR].xrepeat X setactor[THISACTOR].yrepeat Y
I have used this within eventloadactor and it does nothing. Including these strings with ifactor inside EVENT_GAME also does nothing. The only thing which have worked is old style sizeat at the beginning of the actor code, but it resizes the actor upon seeing the player, which is bad. What am I doing wrong? :/
#1295 Posted 31 May 2013 - 12:09 AM
zazo, on 30 May 2013 - 02:30 AM, said:
another command to set a "hit radius" for a melee weapon ? the defineprojectile xxx PROJ_RANGE seems to set the depth but not a radius around the player...
Making an explosive hitscan would require more work.
This post has been edited by Fox: 31 May 2013 - 12:10 AM
#1296 Posted 31 May 2013 - 09:18 AM
Fox, on 31 May 2013 - 12:09 AM, said:
Not too much, though. You could set PROJ_SPAWNS to an actor that explodes with whatever hitradius you want.
#1297 Posted 31 May 2013 - 09:46 AM
#1298 Posted 31 May 2013 - 10:23 AM
Fox, on 31 May 2013 - 12:09 AM, said:
Of course, I am not that stupid

eventloadactor MOSQUITO setactor[THISACTOR].xrepeat 10 setactor[THISACTOR].yrepeat 10 enda
Why it doesn't work? WHYYYY?

Maybe it's because in erampage, but it should work...
#1300 Posted 31 May 2013 - 10:56 AM
Fox, on 31 May 2013 - 10:36 AM, said:
Hard-coded or not, why is it resized freely by "sizeat", but not by the code from above?
This post has been edited by LAW: 31 May 2013 - 10:57 AM
#1301 Posted 31 May 2013 - 11:27 AM
#1303 Posted 31 May 2013 - 12:01 PM
LAW, on 31 May 2013 - 10:56 AM, said:
It shouldn't.
#1304 Posted 01 June 2013 - 02:49 AM
zazo, on 30 May 2013 - 02:30 AM, said:
another command to set a "hit radius" for a melee weapon ? the defineprojectile xxx PROJ_RANGE seems to set the depth but not a radius around the player...
That´s something I´m also interested in.
#1305 Posted 05 June 2013 - 12:29 AM
Trooper Dan, on 31 May 2013 - 09:18 AM, said:
Yes, but it muste be a hitradius that not hurt the player, only enemy. And a "knee" weapon style, not explosion ...
#1306 Posted 08 June 2013 - 05:20 AM
I have an enemy, which does a few things upon dying when spritepal 30, 31 or 32. It works, when that enemy is put on the ground in Build. However, when it is spawned by a RESPAWN it does nothing and judging from its spritepal dependant behaviour it has pal 0. I've come with an idea to put the foe on the conveyor belt, where it could be moved into the silent teleport. But somehow it doesn't bother the conveyor belt's motion and it doesn't fall into the teleport's chasm even though it has 'fall' command in its code. Changing 'actor' to useractor enemy' also doesn't change things.
I've tried to code it out in EVENT_GAME. Maybe my logic is wrong, but I will show, what was done:
gamevar OWNER 0 0 gamevar PAL 0 0 ifactor MAMA getactor[THISACTOR].owner OWNER ifvare OWNER RESPAWN getactor[OWNER].pal PAL setactor[THISACTOR].pal PAL //OR ifvare PAL 30 spritepal 30
It doesn't work. Is there a workaround to have that enemy appear on demand and do the special actions?
This post has been edited by LAW: 08 June 2013 - 05:20 AM