
EDuke32 Scripting "CON coding help"
#78 Posted 06 July 2009 - 08:51 AM
This post has been edited by XThX2: 06 July 2009 - 08:51 AM
#79 Posted 07 July 2009 - 03:14 AM
#80 Posted 07 July 2009 - 05:00 AM
#81 Posted 07 July 2009 - 07:33 AM
Spiker, on Jul 7 2009, 08:00 AM, said:
So your goal is to replace the shotgun with a completely custom art sequence?
Then what you're going to want is getplayer[THISACTOR].kickback_pic.
http://wiki.eduke32....ki/Kickback_pic
From there you can use EVENT_DISPLAYWEAPON to display your frames using rotatesprite.
To define TOTALTIME, etc, you will want these vars:
WEAPONx_CLIP
WEAPONx_FIREDELAY
WEAPONx_FIRESOUND
WEAPONx_FLAGS
WEAPONx_INITIALSOUND
WEAPONx_SHOOTS
WEAPONx_SHOTSPERBURST
WEAPONx_SPAWN
WEAPONx_SPAWNTIME
WEAPONx_TOTALTIME
(too many to link, just look them up on the Wiki)
Note that x indicates the weapon slot number.
EDIT:
Isn't there also a WEAPONx_RELOADTIME or something along those lines? I didn't see it listed in the Wiki, but I seem to recall that when CLIP is reached RELOADTIME is added to TOTALTIME (and thus kickback_pic's value/sequence).
This post has been edited by Mblackwell: 07 July 2009 - 07:38 AM
#82 Posted 07 July 2009 - 07:50 AM
WEAPON2_TOTALTIME 24
WEAPON2_FIREDELAY 18
WEAPON2_RELOADTIME 48
WEAPON2_CLIPS 8
When you exceed the clip amount, it will go for the 25th frame of weapon and go on until it reaches to 48th frame.
#83 Posted 07 July 2009 - 08:26 AM
This post has been edited by Spiker: 07 July 2009 - 08:29 AM
#84 Posted 07 July 2009 - 10:04 AM
ifvare playervar[THISACTOR].a 1
work but,
ifvare actorvar[THISACTOR].a 1
works? I get that this is not an array in the log file but not when I try with actorvar.
Quote
This one is solved.
Quote
This post has been edited by XThX2: 07 July 2009 - 12:17 PM
#85 Posted 07 July 2009 - 12:04 PM
Quote
You could always have the projectile spawn a hidden actor which is synced to the projectiles possition but with some distance infront of it.
Have this hidden actor constantly search for actors within a very small distance (400) and when it finds one, wait a tic or 2 (ifcount 1) and then have the projectile move to the hidden actor's possition (or a little furthre). You'll have to work out some timing to stop the projectile moving too early and end up still on path towards the actor. If you leave it too late then the actor gets hit.
That's what I would have done (but haven't tried it yet)
This post has been edited by Chip: 07 July 2009 - 12:06 PM
#86 Posted 07 July 2009 - 12:19 PM

#87 Posted 11 July 2009 - 06:38 AM
getactor[THISACTOR].owner owner getactor[owner].xvel xvel getactor[owner].yvel yvel getactor[owner].zvel zvel movesprite THISACTOR xvel yvel zvel CLIPMASK0 RETURNVAR
I've been messing with it a lot, multiplied/divided/added/substracted but nothing worked. It all just changed the speed of it. (Multiplying with -1 made the direction change) I also thought about setting up x/y/z values for the actors but then it would case them to disappear in walls/floors/ceilings also this actor needs to move around the main actor and it looks bad when you do it (I got the move thing done by adding up to it's angle per count). A suggestion about this would be nice.
This post has been edited by XThX2: 11 July 2009 - 07:20 AM
#88 Posted 11 July 2009 - 09:40 AM
Example:
getactor[THISACTOR].owner owner getactor[owner].x xvar getactor[owner].y yvar getactor[owner].z zvar subvar zvar 6000 setactor[THISACTOR].x xvar setactor[THISACTOR].y yvar setactor[THISACTOR].z zvar
Question: I once read somewhere that Edue32 only does whole numbers for multiplication and division so you cannot do sometihng like "mulvar TEMP 0.02" Is that true?
This post has been edited by Chip: 11 July 2009 - 09:43 AM
#89 Posted 11 July 2009 - 10:15 AM
#90 Posted 11 July 2009 - 10:19 AM
state rollaround getactor[THISACTOR].ang angle ifcount 2 { spawn FRAMEEFFECT1 addvar angle 64 setactor[THISACTOR].ang angle resetcount } ends
This state is in my owner actor's code, and if you set x/y/z and such of it, it get's stupid. I want this to move in circles around the actor that spawns it. The code above does the circle part, it just needs to move along with the owner actor.
This post has been edited by XThX2: 11 July 2009 - 10:19 AM
#91 Posted 14 July 2009 - 07:27 AM
#92 Posted 14 July 2009 - 07:38 AM
#93 Posted 14 July 2009 - 08:05 AM
This determines which tiles are displayed in the HUD when the weapon is used. It would be more aptly named "LOOKSLIKE" than "WORKSLIKE". Set this to 1 and the weapon will display the pistol art, 2 for shotgun, etc. It is completely useless if you are using your own HUD code.
#94 Posted 14 July 2009 - 08:12 AM
#95 Posted 14 July 2009 - 08:17 AM
Spiker, on Jul 14 2009, 09:12 AM, said:
Maybe he also set WEAPON2_SHOOTS KNEE? Anyway, if the information is wrong someone can fix or delete it.
#96 Posted 14 July 2009 - 08:42 AM
When you begin coding you don't really care what this or other command do or mean in fact you shouldn't even know it. Most tutorials for other programs are constructed in the way that you are introduced to every issue by a series of exercises. For example there could be a tutorial "How to code a custom weapon" and it would contain step by step instructions and explanations what to do as it is in other tutorials like layers in Gimp or rigging and animation in Blender:P.
Of course you won't know everything after completing that tutorial but it would give you more understanding of the code and after some more exercises you will be able to "mix" the code from various exercises and to modify it. There is a perfect tutorial for mapping in build and it's very easy to understand but after reading examples of con coding like making duke eat something, which is also quite easy I still have no idea how to code something more serious and I'm just left with a bunch of commands I don't understand and don't know how to use:P
Sorry if you think I'm pathetic but somehow I can learn from other tutorials with success while here there are just few very simple examples which aren't followed by anything more serious so I'm still stuck in the black hole.

#97 Posted 14 July 2009 - 09:04 AM
Spiker, on Jul 14 2009, 09:42 AM, said:
When you begin coding you don't really care what this or other command do or mean in fact you shouldn't even know it. Most tutorials for other programs are constructed in the way that you are introduced to every issue by a series of exercises. For example there could be a tutorial "How to code a custom weapon" and it would contain step by step instructions and explanations what to do as it is in other tutorials like layers in Gimp or rigging and animation in Blender:P.
Of course you won't know everything after completing that tutorial but it would give you more understanding of the code and after some more exercises you will be able to "mix" the code from various exercises and to modify it. There is a perfect tutorial for mapping in build and it's very easy to understand but after reading examples of con coding like making duke eat something, which is also quite easy I still have no idea how to code something more serious and I'm just left with a bunch of commands I don't understand and don't know how to use:P
Sorry if you think I'm pathetic but somehow I can learn from other tutorials with success while here there are just few very simple examples which aren't followed by anything more serious so I'm still stuck in the black hole.

There were tutorials written a long time ago. For example, Reaper_Man has some here:
http://concode.planetduke.gamespy.com/
Look at "Actions Explained", "Writing a Basic Actor", etc There's also an old tut that covers a lot of stuff on the wiki.
But if you want tutorials that cover the newer EDuke commands, then you're out of luck. There is some stuff on the wiki, but you aren't going to find EDuke CON coding For Dummies.
#98 Posted 14 July 2009 - 10:39 AM
This post has been edited by Captain Awesome: 14 July 2009 - 10:40 AM
#99 Posted 14 July 2009 - 10:41 AM


#100 Posted 14 July 2009 - 10:59 AM

#101 Posted 14 July 2009 - 11:15 AM

This post has been edited by Spiker: 14 July 2009 - 11:15 AM
#102 Posted 14 July 2009 - 01:44 PM
Spiker, on Jul 14 2009, 11:42 AM, said:
When you begin coding you don't really care what this or other command do or mean in fact you shouldn't even know it. Most tutorials for other programs are constructed in the way that you are introduced to every issue by a series of exercises. For example there could be a tutorial "How to code a custom weapon" and it would contain step by step instructions and explanations what to do as it is in other tutorials like layers in Gimp or rigging and animation in Blender:P.
Of course you won't know everything after completing that tutorial but it would give you more understanding of the code and after some more exercises you will be able to "mix" the code from various exercises and to modify it. There is a perfect tutorial for mapping in build and it's very easy to understand but after reading examples of con coding like making duke eat something, which is also quite easy I still have no idea how to code something more serious and I'm just left with a bunch of commands I don't understand and don't know how to use:P
Sorry if you think I'm pathetic but somehow I can learn from other tutorials with success while here there are just few very simple examples which aren't followed by anything more serious so I'm still stuck in the black hole.

http://wiki.eduke32.com/wiki/Confaq42
I also have an old Eduke 2.0 con FAQ somewhere. Perhaps I should add it to the Wiki?
This post has been edited by Mblackwell: 14 July 2009 - 01:44 PM
#103 Posted 14 July 2009 - 06:11 PM
or have the old confaq updated to include EDuke32 concepts.
#104 Posted 15 July 2009 - 05:51 AM
ifvarand WEAPON8_FLAGS 3328 { subvar WEAPON8_FLAGS 3328 setvar WEAPON8_FLAGS 4 }
I don't know why, but this little change refuses to work. This code is in the EVENT_FIREWEAPON event, under a switch which checks the current weapon of the player. I used a simple setvar command at first, but addlogvar command showed that the flags are still set to 3328 ( 2048, 1024 and 256; STAND_STILL (this must go away), CHECKATRELOAD (some specific tripbomb control) and NOVISIBLE). Is this hardcoded?
#105 Posted 15 July 2009 - 08:03 AM
#106 Posted 15 July 2009 - 08:19 AM
This post has been edited by XThX2: 15 July 2009 - 08:19 AM
#107 Posted 15 July 2009 - 02:14 PM
Locked

Unlocked, with Key

Unlocked, without Key
