
EDuke32 Scripting "CON coding help"
#1914 Posted 01 January 2017 - 09:35 AM
It seem to works. I have added resetcount just after soundonce SWITCH_ON
Thanks a lot,
DotK3D
PS : I have read somewhere that a EVENT_DAMAGEWALL was planned, to do custom breakable screens If I have understand correctly, is it available ?
This post has been edited by DotK3D: 01 January 2017 - 09:37 AM
#1917 Posted 13 January 2017 - 11:29 AM
define _BPRESS #### defineprojectile _BPRESS PROJ_WORKSLIKE 1 // or 16 defineprojectile _BPRESS PROJ_EXTRA 1 // or 0 defineprojectile _BPRESS PROJ_XREPEAT 4 defineprojectile _BPRESS PROJ_XREPEAT 4 defineprojectile _BPRESS PROJ_RANGE 128 onevent EVENT_KILLIT switch sprite[THISACTOR].picnum ... case FIRELASER case PLASMA_PROJ case ... shoot _BPRESS break endswitch endevent
I tried various combinations of size, damage, no_aim flag, zshoot at 0, different range...
Is something wrong/odd in the projectile declaration, or is the whole idea wrong and there are other ways to do that ?
// edit
Also, i would know the description of the PROJECTILE_REALCLIPDIST, _ACCURATE and _NOSETOWNERSHADE flags, not yet on wiki
This post has been edited by RichardStorm: 13 January 2017 - 11:42 AM
#1918 Posted 13 January 2017 - 12:00 PM
ACCURATE: Bullet-type projectile doesn't spread.
NOSETOWNERSHADE: Shooting actor won't glow when firing the projectile.
This post has been edited by Fox: 13 January 2017 - 12:01 PM
#1919 Posted 30 January 2017 - 04:15 PM
For starters, what are the min/max values for the angoff command? It is not stated in the Wiki. Second, am I going about it all wrong?
Editing the model itself is a last resort because of it being an md3 and not something with a skeleton. I would have to manually spin all the frames by 90 degrees to keep it intact.
This post has been edited by Mark.: 30 January 2017 - 04:20 PM
#1920 Posted 30 January 2017 - 04:59 PM
#1921 Posted 31 January 2017 - 09:06 PM
#1922 Posted 01 February 2017 - 04:13 AM
If I knew how, I would add that info to the wiki.
This post has been edited by Mark.: 01 February 2017 - 04:42 AM
#1923 Posted 02 February 2017 - 07:57 PM
This post has been edited by Gambini: 02 February 2017 - 08:26 PM
#1924 Posted 02 February 2017 - 09:10 PM
define JETSKI 5440 define JETSKISHOOT 5441 define JETSKI_DRIVER 5446 spritenvg JETSKI spritenvg JETSKI_DRIVER spriteshadow JETSKI //JETSKI define JETSKISTRENGTH 150 action JETSKISTAND 0 1 1 action JETSKIRUN 0 1 1 action JETSKISHOOT 0 2 1 4 action JETSKI_DRIVERSTAND 0 1 5 move JETSKIRUNVEL 150 move JETSKISTOP ai AIJETSKIGETENEMY JETSKIRUN JETSKIRUNVEL seekplayer ai AIJETSKISHOOTENEMY JETSKIRUN JETSKIRUNVEL faceplayer useractor notenemy JETSKI_DRIVER 0 ifvarn target -1 { ifvare actorvar[target].peractor1 -1 killit sizeat 40 40 getactor[target].z z action JETSKI_DRIVERSTAND cstat 0 setsprite THISACTOR sprite[target].x sprite[target].y z setangle THISACTOR [target].ang } enda useractor enemy JETSKI JETSKISTRENGTH fall ifaction 0 { fall sizeat 58 58 action JETSKIRUN cstat 257 espawn JETSKI_DRIVER setactorvar[RETURN].target THISACTOR setvarvar peractor1 RETURN } ifmove 0 move JETSKIRUNVEL faceplayer enda
This post has been edited by Gambini: 02 February 2017 - 09:11 PM
#1925 Posted 02 February 2017 - 09:24 PM
ifvarn target -1
{
ifvare actorvar[target].peractor1 -1 killit
sizeat 40 40
getactor[target].z z
action JETSKI_DRIVERSTAND
cstat 0
setsprite THISACTOR sprite[target].x sprite[target].y z
setactor[THISACTOR].ang sprite[target].ang
}
enda
#1926 Posted 02 February 2017 - 09:28 PM
#1927 Posted 02 February 2017 - 10:11 PM
Mblackwell, on 02 February 2017 - 09:28 PM, said:
He copied the code from a different actor where it made sense to have that line. I think it was code I wrote that had an enemy spawning a force field or something similar. There were other parts to it which didn't get copied. I left it in my edit because it wasn't related to the angle issue and it could become relevant later if more code is added.
#1928 Posted 03 February 2017 - 05:04 PM
Yes I based most of this by looking at code of actors that behaved similar to what i wanted. The driver (or attached sprite) is the tentacles code of the EDF troopers, i removed the pal specific lines but didn´t touch that ifvare actorvar[target].peractor1 -1 killit because i dont have a clue of what it is.
#1929 Posted 17 February 2017 - 07:38 PM
#1930 Posted 17 February 2017 - 09:10 PM
Mark., on 17 February 2017 - 07:38 PM, said:
http://wiki.eduke32....i/WEAPONx_FLAGS
orvar 256 on the weapon#_flags corresponding to the weapon
#1931 Posted 18 February 2017 - 04:09 AM
// NO GLOBAL FLASH WHEN FIRING PISTOL SHOTGUN CHAINGUN
onevent EVENT_RESETWEAPONS
setvarvar gs WEAPON1_FLAGS
setvarvar gs WEAPON2_FLAGS
setvarvar gs WEAPON3_FLAGS
orvar gs 256
setvarvar WEAPON1_FLAGS gs
setvarvar WEAPON2_FLAGS gs
setvarvar WEAPON3_FLAGS gs
endevent
EDIT: CODE PRODUCED A GLITCH. DO NOT USE AS-IS
This post has been edited by Mark.: 18 February 2017 - 08:25 AM
#1932 Posted 18 February 2017 - 06:31 AM
http://wiki.eduke32.com/wiki/Gs
#1933 Posted 18 February 2017 - 06:45 AM
Mark., on 18 February 2017 - 04:09 AM, said:
// NO GLOBAL FLASH WHEN FIRING PISTOL SHOTGUN CHAINGUN
onevent EVENT_RESETWEAPONS
setvarvar gs WEAPON1_FLAGS
setvarvar gs WEAPON2_FLAGS
setvarvar gs WEAPON3_FLAGS
The var can only store one value at a time, so it's equal to WEAPON3_FLAGS as of that last line...
#1934 Posted 18 February 2017 - 07:57 AM
EDIT: It works as intended removing the flash but it messed up the firing making those 3 weapons rapid fire like the chaingun. I'll have to also check to see if it affected Graveyard in the same way. Nobody ever reported the issue.... No rapid firing pistol or shotgun in Graveyard but I did not have the chaingun in it's noflash con. If I remove the noflash for weapon3, the chaingun, firing sequence goes back to normal for the pistol and shotgun while still keeping the noflash for those 2.
So I guess it will noflash for just those 2. I can live with that if no other glitches show up.
This post has been edited by Mark.: 18 February 2017 - 08:28 AM
#1935 Posted 18 February 2017 - 09:46 AM
I suppose it's the right thread to post that question, so is there any way to control an animated 3d model with the 'use' key ?
What I mean is a 3d model which starts its animation forward or backward each time the player presses the "use" key when looking at it : for example an animated switch, a valve wheel or a door.
Does anyone think it's possible - and possibly knows the way one could do that ?
#1936 Posted 18 February 2017 - 12:40 PM
There are other ways including con coding with the "ifhitspace" command which detects when the use key is pressed. But the above does not require con code. Just def'ing in the new model to replace the old.
This post has been edited by Mark.: 18 February 2017 - 12:47 PM
#1937 Posted 18 February 2017 - 12:56 PM
Mark., on 18 February 2017 - 07:57 AM, said:
Yes, for the reason I pointed out in my post immediately above yours. You used the chaingun value to set all 3 weapons.
#1938 Posted 18 February 2017 - 04:40 PM
#1939 Posted 18 February 2017 - 04:51 PM
Mark., on 18 February 2017 - 04:40 PM, said:
You aren't even using gs as the engine gun shade variable. You may as well replace it with a temp var. You are just storing the weapon flag value there then orvaring it. You should do the orvar once per weapon.
onevent EVENT_RESETWEAPONS setvarvar temp WEAPON1_FLAGS orvar temp 256 setvarvar WEAPON1_FLAGS temp setvarvar temp WEAPON2_FLAGS orvar temp 256 setvarvar WEAPON2_FLAGS temp setvarvar temp WEAPON3_FLAGS orvar temp 256 setvarvar WEAPON3_FLAGS temp endevent
Posted from my phone sorry in advance for any errors.
#1940 Posted 18 February 2017 - 05:00 PM
David B., on 18 February 2017 - 09:46 AM, said:
I suppose it's the right thread to post that question, so is there any way to control an animated 3d model with the 'use' key ?
What I mean is a 3d model which starts its animation forward or backward each time the player presses the "use" key when looking at it : for example an animated switch, a valve wheel or a door.
Does anyone think it's possible - and possibly knows the way one could do that ?
Yes. I have made working door models.
1 the models work best with clip shape maps for blocking IMO
2 ifhitspace is the con command you'll want to use
3 I made two states one was advance a tile num, the other subtracted one from the picnum
4 like in defs.con define two tiles as your model states aka open/closed
5 like in game.con write code for each state of the model to switch picnum to opposite state if it detects hitspace
6 add sounds via soundonce con code
Good luck feel free to ask more or for clarification.
#1941 Posted 18 February 2017 - 07:24 PM

#1942 Posted 19 February 2017 - 12:46 PM
David B., on 18 February 2017 - 09:46 AM, said:
Drek, on 18 February 2017 - 05:00 PM, said:
I found the old project and copied out the code for reference.
#1943 Posted 21 February 2017 - 09:57 AM
Drek, on 19 February 2017 - 12:46 PM, said:
That's great, thanks. In fact I have never made a script and I didn't know how to begin.
Well I'm not very skilled in coding.
I'm wondering how the door is animated when it's closing.
And also why there is a counter to 32.
This post has been edited by David B.: 21 February 2017 - 10:47 AM