EDuke32 Scripting "CON coding help"
#1231 Posted 17 April 2013 - 03:20 PM
I know I can copy and def those sprite tiles to new tile numbers and animate them. I can lose the burn, but I would also lose their flickering Polymer lights.
#1232 Posted 17 April 2013 - 06:30 PM
state firestate ifaction 0 ifrnd 16 { action FIRE_FRAMES cstator 128 } sleeptime 300 // Never let it fall to sleep ifspawnedby FIRE { ifgapzl 16 break } else ifspawnedby FIRE2 { ifgapzl 16 break } ifinwater killit ifp palive ifpdistl 844 ifrnd 32 ifcansee { soundonce DUKE_LONGTERM_PAIN addphealth -1 palfrom 32 32 } ifactor FIRE { ifspawnedby FIRE break } else ifactor FIRE2 ifspawnedby FIRE2 break iffloordistl 128 { ifrnd 128 { ifcount 84 killit // This line(and the else below) // is not necessary, since actors // with zero x-size are automatically // deleted anyway! else ifcount 42 sizeto 0 0 else sizeto 32 32 } } else killit ends useractor notenemy FIRE WEAK 0 FIREVELS state firestate enda
#1233 Posted 17 April 2013 - 08:55 PM
Mikko_Sandt, on 16 April 2013 - 05:35 AM, said:
Edit: The projectiles are RPG-like.
I think changing offset is the correct thing to do, but you should change it before the projectile is fired, not afterwards.
e.g.
setprojectile[NAMEOFPROJECTILE].offset 128 shoot NAMEOFPROJECTILE setprojectile[NAMEOFPROJECTILE].offset 0
In the example, the offset is set back to 0 after firing, in case another actor needs to use it (setprojectile changes the definition of the custom projectile).
#1234 Posted 18 April 2013 - 02:54 PM
#1235 Posted 18 April 2013 - 06:48 PM
This post has been edited by Fox: 18 April 2013 - 06:49 PM
#1236 Posted 21 April 2013 - 07:50 AM
define WOODBREAK1 3816
useractor notenemy WOODBREAK1
cstat 257
ifhitweapon
{
sound VENT_BUST
debris SCRAP1 4
killit
}
enda
Instead of breaking code I know I can give the panels a hitag to make them disappear when hit but then there is no sound or debris.
#1237 Posted 21 April 2013 - 07:59 AM
Here is a code which you could also define the hit points (where is says "WEAKEST" which equals 1)
useractor notenemy WOODBREAK1 WEAKEST cstator 257 ifhitweapon ifdead { sound VENT_BUST debris SCRAP1 4 killit } enda
This post has been edited by Fox: 21 April 2013 - 08:05 AM
#1238 Posted 21 April 2013 - 08:28 AM
#1239 Posted 21 April 2013 - 08:39 AM
#1240 Posted 21 April 2013 - 08:41 AM
#1241 Posted 21 April 2013 - 08:53 AM
useractor notenemy WOODBREAK1 cstator 257 strength 1 ifhitweapon ifwasweapon KNEE { sound VENT_BUST debris SCRAP1 4 killit } enda
This post has been edited by Fox: 21 April 2013 - 08:54 AM
#1242 Posted 21 April 2013 - 08:57 AM
Cool. Duke is kickin' planks and chewing bubblegum. I'm attempting all this minor stuff now after my failures of trying to code new enemies. I needed a success to keep me sane. So next up is finding a better sound effect for the break.
This post has been edited by Mark.: 21 April 2013 - 09:12 AM
#1243 Posted 23 April 2013 - 11:57 AM
When the player jumps and lands on a sector that is lower than the previous one, besides the hard landing and view centering stuff, his movement speed will decrease for a fraction of a second. I would like to avoid that if the height difference between sectors is not very big - is that actually possible? I have already avoided the view centering, but I'm making a platform section in one of my maps where the player has to make a series of quick jumps and the movement speed reduction is annoying - makes it easy and frustrating to die.
This post has been edited by Diaz: 23 April 2013 - 11:57 AM
#1244 Posted 23 April 2013 - 12:21 PM
#1245 Posted 23 April 2013 - 01:01 PM
#1246 Posted 23 April 2013 - 07:54 PM
onevent EVENT_JUMP setplayer[THISACTOR].poszv -2048 // or some other value setvar RETURN -1 endevent
This destroys any ifp pjumping code however.
#1247 Posted 23 April 2013 - 07:59 PM
onevent EVENT_GETLOADTILE
setvar RETURN 7119
endevent
onevent EVENT_GETMENUTILE
setvar RETURN 7119
endevent
I replaced the load and menu screens with my own but I can't figure out the name for the DREALMS tile 2492 so I can replace it. I tried a few variations of the word DREALMS between "GET" and "TILE" but no luck.
#1248 Posted 23 April 2013 - 08:21 PM
gamevar LOGO_FLAGS <someval> 0
Also
http://wiki.eduke32....wiki/EVENT_LOGO
#1249 Posted 23 April 2013 - 08:41 PM
#1250 Posted 23 April 2013 - 10:28 PM
Mblackwell, on 23 April 2013 - 07:54 PM, said:
onevent EVENT_JUMP setplayer[THISACTOR].poszv -2048 // or some other value setvar RETURN -1 endevent
This destroys any ifp pjumping code however.
That does what I want, however it has side effects:
- As you have mentioned, ifp pjumping code is destroyed, though I think I can safely replace all instances of "ifp pjumping" with a check for the player's z velocity.
- The player can now bunnyhop like crazy if keeping the jump key depressed (no idea how to fix this).
- Jumping to get out of water messes up.
So, not worth it
This post has been edited by Diaz: 23 April 2013 - 10:37 PM
#1251 Posted 24 April 2013 - 03:38 AM
Mark., on 23 April 2013 - 07:59 PM, said:
onevent EVENT_GETLOADTILE
setvar RETURN 7119
endevent
onevent EVENT_GETMENUTILE
setvar RETURN 7119
endevent
I replaced the load and menu screens with my own but I can't figure out the name for the DREALMS tile 2492 so I can replace it. I tried a few variations of the word DREALMS between "GET" and "TILE" but no luck.
There is no such a thing as a event that control the 3DRealms screen. You need to replace the tile.
#1252 Posted 25 April 2013 - 09:11 AM
Diaz, on 23 April 2013 - 10:28 PM, said:
- As you have mentioned, ifp pjumping code is destroyed, though I think I can safely replace all instances of "ifp pjumping" with a check for the player's z velocity.
- The player can now bunnyhop like crazy if keeping the jump key depressed (no idea how to fix this).
- Jumping to get out of water messes up.
So, not worth it
gamevar P_JUMP 0 1 onevent EVENT_JUMP ifvare P_JUMP 0 setplayer[THISACTOR].poszv -2048 setvar RETURN -1 setvar P_JUMP 3 enda actor APLAYER ifvarg P_JUMP 0 subvar P_JUMP 1 ifvarn P_JUMP 0 action PJUMPING enda
For example.
If necessary you can add a condition for when you're in water.
#1253 Posted 26 April 2013 - 09:47 AM
#1254 Posted 26 April 2013 - 10:28 AM
#1256 Posted 26 April 2013 - 03:59 PM
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
#1257 Posted 26 April 2013 - 10:58 PM
#1258 Posted 27 April 2013 - 10:06 AM
Is a way to spot them and correct them ?
#1259 Posted 27 April 2013 - 10:08 AM
#1260 Posted 27 April 2013 - 10:10 AM
Hendricks266, on 27 April 2013 - 10:08 AM, said:
interesting, a link to download this palette ?