
EDuke32 Scripting "CON coding help"
#1223 Posted 16 April 2013 - 08:33 AM
can someone help me with this problem
Im using transport elevator (SE 17) and I have done everything correctly...
but there is in 0:02 a little lag and I dont know why...
It seems, this is problem even in original maps(Episode 3 level 4 example L.A Rumble)...i tried few things but problem is still there.
This "lag" appears only when elevator is going up, when you are going down its OK...
any suggestions? maybe its a old problem, but is there some solution for this?
thanks,
#1224 Posted 16 April 2013 - 08:39 AM
#1225 Posted 16 April 2013 - 08:46 AM
Fox, on 16 April 2013 - 08:39 AM, said:
thanks for reply, so there isnt some way how to solve it? Trough CON, or maybe write my own teleport elevators...

#1226 Posted 16 April 2013 - 09:22 AM
Fox, on 16 April 2013 - 06:53 AM, said:
So I guess that means it's time to dig up the trigonometry book...
#1227 Posted 16 April 2013 - 09:54 AM
Biturbo, on 16 April 2013 - 08:46 AM, said:

if it's any consolation, you also notice this glitch in the original game.
#1228 Posted 16 April 2013 - 11:35 AM
Mikko_Sandt, on 16 April 2013 - 05:35 AM, said:
Edit: The projectiles are RPG-like.
Would declaring these projectiles as DEVISTATOR-like (sic) do the trick? Here's what happens, from player.c:A_ShootWithZvel(), irrelevant parts omitted.
else if (PWEAPON(0, g_player[p].ps->curr_weapon, WorksLike) == DEVISTATOR_WEAPON) { // (...) if (g_player[p].ps->hbomb_hold_delay) { sprite[j].x -= sintable[sa&2047]/644; sprite[j].y -= sintable[(sa+1024+512)&2047]/644; } else { sprite[j].x += sintable[sa&2047]>>8; sprite[j].y += sintable[(sa+1024+512)&2047]>>8; } // (...) }
The thing to note here is that the offset in the two directions is not the same even if symmetry around the center is to be achieved.
#1229 Posted 17 April 2013 - 03:32 AM
#1230 Posted 17 April 2013 - 02:11 PM
Thanks!
EDIT: Nevermind, it looks like everything is in the APLAYER actor. Perhaps it's not even standard behavior, I've just been working with my old Fusion CONs as a base ever since I finished it...
This post has been edited by Diaz: 17 April 2013 - 02:20 PM
#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.