
EDuke32 Scripting "CON coding help"
#774 Posted 03 April 2012 - 04:20 AM
This post has been edited by Superthijs: 03 April 2012 - 04:53 AM
#775 Posted 03 April 2012 - 04:55 AM
#776 Posted 03 April 2012 - 05:00 AM

I actually mean that, if the cstat is 14, 52 or 25, or something like that, I want to subtract 1 of the cstat.
So I need to check if the sprite is blocked or not.
This post has been edited by Superthijs: 03 April 2012 - 05:00 AM
#777 Posted 03 April 2012 - 05:10 AM
andvar X 0xFFFFFFFE
This is proposed by CraigFatman, but I find the "obvious" version easier to read (and unlikely to be different performance-wide unless used in a tight loop):
ifandvar X 1 subvar X 1
#778 Posted 03 April 2012 - 03:12 PM
Helixhorned, on 03 April 2012 - 05:10 AM, said:
andvar X 0xFFFFFFFE
This is proposed by CraigFatman, but I find the "obvious" version easier to read (and unlikely to be different performance-wide unless used in a tight loop):
ifandvar X 1 subvar X 1
DT suggested:
ifandvar X 1 xorvar X 1
It would be easier if we had nandvar, I think.
This post has been edited by Hendricks266: 03 April 2012 - 03:14 PM
#779 Posted 03 April 2012 - 09:44 PM
Superthijs, on 03 April 2012 - 05:00 AM, said:

I actually mean that, if the cstat is 14, 52 or 25, or something like that, I want to subtract 1 of the cstat.
So I need to check if the sprite is blocked or not.
Use getactor[THISACTOR].cstat CSTAT to get the cstat into a variable called CSTAT. Then you can check if it's already blocking or not by using ifvaror CSTAT 1.
If not, just add 1 to the variable and use setactor[THISACTOR].cstat CSTAT to set the updated value.
#781 Posted 04 April 2012 - 04:37 AM
#782 Posted 04 April 2012 - 09:00 AM
#784 Posted 12 April 2012 - 04:05 AM
I'm using this code to simulate jetpack flames, but it doesn't wait between the spawning of the flames.
After half a second, the game crashes showing the 'too many sprites spawned' message.

onevent EVENT_GAME ifp pjetpack { ifcount 2 { espawn EXPLOSION2 setactor[RETURN].xrepeat 16 setactor[RETURN].yrepeat 16 resetcount } } endevent
I have the feeling I'm doing something wrong.
Any ideas?
This post has been edited by Superthijs: 12 April 2012 - 04:10 AM
#785 Posted 12 April 2012 - 05:21 AM
#786 Posted 12 April 2012 - 05:30 AM

This post has been edited by rasmus thorup: 12 April 2012 - 05:31 AM
#788 Posted 12 April 2012 - 09:00 AM

How do I make an actor shoot a projectile with another vertical angle? I've managed to make it shoot towards where the player is looking at,
but it keeps shooting at the same vertical angle. Even when the player looks up or down.
#790 Posted 12 April 2012 - 03:47 PM
Superthijs, on 12 April 2012 - 09:00 AM, said:

How do I make an actor shoot a projectile with another vertical angle? I've managed to make it shoot towards where the player is looking at,
but it keeps shooting at the same vertical angle. Even when the player looks up or down.
In addition to what Hendricks said, if you know your target:
http://wiki.eduke32....or_aim_vertical
#791 Posted 13 April 2012 - 08:45 AM
#792 Posted 13 April 2012 - 08:58 AM
#793 Posted 13 April 2012 - 10:16 AM
#794 Posted 14 April 2012 - 02:32 AM
#796 Posted 14 April 2012 - 07:29 AM
rasmus thorup, on 13 April 2012 - 10:16 AM, said:
Yeah, I think that's what I need. But how do I convert the 'horiz' number to a slope value, e.g. 4096?
#797 Posted 14 April 2012 - 07:42 AM
#798 Posted 14 April 2012 - 09:58 AM
Superthijs, on 14 April 2012 - 07:29 AM, said:
Subtract 100, multiply with 32 (= 4096/128).
#799 Posted 15 April 2012 - 01:06 PM
getflorzofslope sectnum x y z getsector[sect2].floorz z2 subvarvar z z2 divvar z 2 setsector[sect2].floorslope z
And this code works slowly with the formation of gap. Any ideas for fix it?

Second question - How can I get a level name and show this on display?
This post has been edited by M210: 15 April 2012 - 01:07 PM
#801 Posted 15 April 2012 - 10:37 PM
M210, on 15 April 2012 - 01:06 PM, said:
qgetsysstr
#802 Posted 15 April 2012 - 11:06 PM
Fox, on 15 April 2012 - 10:31 PM, said:
It get floor slope (like floor vertical angle) to a given value of z coordinate.
If z coordinate is changing by moving sector, my code no time to determine the exact position and the gap is obtained.
Hendricks266, on 15 April 2012 - 10:37 PM, said:
Thanks a lot

This post has been edited by M210: 15 April 2012 - 11:07 PM
#803 Posted 19 April 2012 - 10:45 AM
Quote
It's not a read-only value! And I not want to set statnum = 14 manually. What can I do else?