EDuke32 Scripting "CON coding help"
#1621 Posted 13 June 2015 - 10:18 AM
#1622 Posted 01 July 2015 - 03:21 PM
#1623 Posted 01 July 2015 - 04:22 PM
Trooper Dan, on 01 July 2015 - 03:21 PM, said:
http://wiki.eduke32....wiki/LOGO_FLAGS
#1624 Posted 09 July 2015 - 09:53 PM
Can I submit a variable from one lua-class to other lua-class?
I must use a function?
Why doesn't work suck code
-- Main.lua module(...) se = con.actorvar(0) require "end_gamevars" local se64 = require("se64")
and I have an error in se64 lua class:
-- SE64.lua local se = se
"attempt to read undeclared variable 'se' "
Can I submit se variable from Main to SE64?
This post has been edited by M210: 10 July 2015 - 08:30 AM
#1625 Posted 11 July 2015 - 05:07 AM
Cus someone told me how. No need for that post.
This post has been edited by Zaxtor: 22 July 2015 - 08:22 AM
#1626 Posted 27 August 2015 - 08:49 AM
#1627 Posted 27 August 2015 - 10:28 AM
#1628 Posted 31 August 2015 - 10:05 AM
#1629 Posted 04 September 2015 - 12:34 AM
I tried ifawayfromwall - works only on border of two sectors. On a step for example. If to stand at a wall, distance too big. Player too thick
This post has been edited by Mr. Alias Nameless: 04 September 2015 - 12:34 AM
#1630 Posted 05 September 2015 - 12:48 PM
Mr. Alias Nameless, on 04 September 2015 - 12:34 AM, said:
I tried ifawayfromwall - works only on border of two sectors. On a step for example. If to stand at a wall, distance too big. Player too thick
You can use hitscan, but it's not easy. You would have to scan from the player's position at at least two different heights and many different angles. Then check the return values. If one of the scans hit a wall at nearby coordinates, then the player is "touching" the wall. If you require the player to be facing the wall, then it's only a few scans. I have some code which does this as part of the mantle check in DukePlus.
#1631 Posted 05 September 2015 - 01:08 PM
Mr. Alias Nameless, on 04 September 2015 - 12:34 AM, said:
I tried ifawayfromwall - works only on border of two sectors. On a step for example. If to stand at a wall, distance too big. Player too thick
http://wiki.eduke32.com/wiki/Htmovflag
#1632 Posted 05 September 2015 - 03:56 PM
Fox, on 05 September 2015 - 01:08 PM, said:
That will help if he wants to know whether the player is pushing against a wall, but if the player is touching a wall without pushing against it, it won't help.
#1633 Posted 05 September 2015 - 07:03 PM
#1634 Posted 05 September 2015 - 07:49 PM
This post has been edited by Mark.: 05 September 2015 - 07:50 PM
#1635 Posted 05 September 2015 - 09:52 PM
#1636 Posted 12 September 2015 - 04:50 AM
#1637 Posted 12 September 2015 - 05:01 AM
December Man, on 12 September 2015 - 04:50 AM, said:
Yeah - I only have time to give you code for the first, the easiest way is to detect if the 'Secret found!' quote is displayed on screen. You can stick this anywhere in the APLAYER actor:
ifvare player[THISACTOR].fta 99 // is a quote being displayed? { ifvare player[THISACTOR].ftq 9 // is it the 'secret found!' quote? soundonce SECRETFOUND // play this sound }
I'm sure it would work with checking the sector lotag as well but I haven't tested that.
This post has been edited by Jblade: 12 September 2015 - 05:02 AM
#1638 Posted 12 September 2015 - 07:46 AM
Jblade, on 12 September 2015 - 05:01 AM, said:
Thanks man. I'm a total beginner and I'm learning con editing through eduke wikia and pure trial and error. I guess I figured it out that the way to do it was through detecting the quote, just had no idea how to do it. Thanks again!
#1639 Posted 12 September 2015 - 09:09 AM
December Man, on 12 September 2015 - 07:46 AM, said:
Be warned that the quote method will not work if the player has messages turned off with F8.
Unfortunately, I can't find any events that run before the game checks for sector lotag 32767 and sets it to zero, but this is the best I can do:
gamevar previous_secret_rooms 0 1 onevent EVENT_GAME ifactor APLAYER { ifvarvarg player[THISACTOR].secret_rooms previous_secret_rooms globalsound BAR_MUSIC getplayer[THISACTOR].secret_rooms previous_secret_rooms } endevent
#1640 Posted 12 September 2015 - 10:11 AM
Hendricks266, on 12 September 2015 - 09:09 AM, said:
Makes sense. Thanks man.
#1641 Posted 12 September 2015 - 05:03 PM
Hendricks266, on 12 September 2015 - 09:09 AM, said:
It's flawless as far I can tell, except for some multiplayer nuisances.
#1642 Posted 13 September 2015 - 10:31 AM
#1643 Posted 13 September 2015 - 10:55 AM
#1644 Posted 15 September 2015 - 11:13 AM
Mblackwell, on 13 September 2015 - 10:55 AM, said:
Ok, now I know what, but I don't know how. Sorry.
#1645 Posted 15 September 2015 - 03:21 PM
eg
gamevar AIR_LEFT 0 1 gamevar AIR_LEFT_LAST 0 1 onevent EVENT_GAME ifactor APLAYER { getplayer[THISACTOR].airleft AIR_LEFT ifvarvarn AIR_LEFT AIR_LEFT_LAST ifvare AIR_LEFT_LAST 0 soundonce MY_GASP_SOUND else ifvare AIR_LEFT 0 soundonce MY_DROWNING_SOUND setvarvar AIR_LEFT_LAST AIR_LEFT } endevent
#1646 Posted 16 September 2015 - 12:29 PM
Mblackwell, on 15 September 2015 - 03:21 PM, said:
Thanks for your patience, however at the beginning of the first level of an episode or a user level the gasp for air (not drowning) sound can be heard. Subsequent levels for some reason do not have this problem.
#1647 Posted 16 September 2015 - 02:49 PM
Mblackwell, on 15 September 2015 - 03:21 PM, said:
gamevar AIR_LEFT 0 1 gamevar AIR_LEFT_LAST 0 1 onevent EVENT_GAME ifactor APLAYER { getplayer[THISACTOR].airleft AIR_LEFT ifvarvarn AIR_LEFT AIR_LEFT_LAST ifvare AIR_LEFT_LAST 0 soundonce MY_GASP_SOUND else ifvare AIR_LEFT 0 soundonce MY_DROWNING_SOUND setvarvar AIR_LEFT_LAST AIR_LEFT } endevent
Fixes:
AIR_LEFT doesn't need to be per-player. Its value isn't kept between tics.
The sound kept playing after the player dies from drowning.
The bug mentioned above.
gamevar temp 0 0 gamevar AIR_LEFT_LAST -1 1 onevent EVENT_GAME ifactor APLAYER { getplayer[THISACTOR].airleft temp ifvare AIR_LEFT_LAST -1 setvarvar AIR_LEFT_LAST temp ifvarvarn temp AIR_LEFT_LAST ifvare AIR_LEFT_LAST 0 soundonce BAR_MUSIC else ifvare temp 0 ifp palive soundonce DUKE_KILLED1 setvarvar AIR_LEFT_LAST temp } endevent
#1649 Posted 21 September 2015 - 11:13 AM
TTFN,
Jon