Duke4.net Forums: EDuke32 Scripting - Duke4.net Forums

Jump to content

  • 124 Pages +
  • « First
  • 25
  • 26
  • 27
  • 28
  • 29
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EDuke32 Scripting  "CON coding help"

User is offline   Superthijs 

#774

How do I unblock a sprite in code?

This post has been edited by Superthijs: 03 April 2012 - 04:53 AM

0

User is offline   Mblackwell 

  • Evil Overlord

#775

http://wiki.eduke32.com/wiki/Cstat

eg:
cstat 0
or
setactor[THISACTOR].cstat 0
0

User is offline   Superthijs 

#776

Yeah, I know, sorry, I should have explained a little bit more. :)
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

0

User is offline   Helixhorned 

  • EDuke32 Developer

#777

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

0

User is offline   Hendricks266 

  • Weaponized Autism

  #778

View PostHelixhorned, 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

0

User is offline   Diaz 

#779

View PostSuperthijs, on 03 April 2012 - 05:00 AM, said:

Yeah, I know, sorry, I should have explained a little bit more. :)
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.
0

#780

It's ifvarand if i remember correctly.
0

User is offline   Diaz 

#781

Hmmm... I use ifvaror on some parts of my code and it seems to work..
0

#782

I always forget what those, and, xor things does. Would be nice if someone could write something on the wiki, the wiki isn't very helpful right now. But ifvarand works for me when i check if a bit number is on.
0

User is offline   Superthijs 

#783

Thank you guys! :)
0

User is offline   Superthijs 

#784

I have another question: Doesn't 'ifcount' work inside an event?
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

0

User is offline   Diaz 

#785

ifcount is an actor counter. That code should go inside the APLAYER actor code instead of EVENT_GAME.
0

#786

You can also put a ifactor APLAYER command so only the APLAYER will spawn it. Though i am not sure if this will work because of the count thing. But i want to know <_<

This post has been edited by rasmus thorup: 12 April 2012 - 05:31 AM

0

User is offline   Superthijs 

#787

Thanks!
0

User is offline   Superthijs 

#788

Sorry, I'm just overloaded with questions... <_<
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.
0

User is offline   Hendricks266 

  • Weaponized Autism

  #789

zshoot
0

User is offline   Mblackwell 

  • Evil Overlord

#790

View PostSuperthijs, on 12 April 2012 - 09:00 AM, said:

Sorry, I'm just overloaded with questions... <_<
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
0

User is offline   Superthijs 

#791

I don't have a specific target, I just want it to shoot freely.
0

User is offline   Superthijs 

#792

So how do I get the player's vertical angle, just like a sector slope (e.g. 4096)?
0

#793

Do you mean this? http://wiki.eduke32.com/wiki/Horiz
Someone messed up.
0

User is offline   sedition 

#794

Is there a special editor for EDuke-Scripting? I´m working with Notepad++, but I was wondering if there´s a special one which works better with Con-Scripting.
0

#795

No. that's what most of us use.
0

User is offline   Superthijs 

#796

View Postrasmus thorup, on 13 April 2012 - 10:16 AM, said:

Do you mean this? http://wiki.eduke32.com/wiki/Horiz
Someone messed up.


Yeah, I think that's what I need. But how do I convert the 'horiz' number to a slope value, e.g. 4096?
0

#797

I don't know the values for horiz and zshoot. You should be able to test that yourself. Do you know how to display numbers on screen?
0

User is offline   Helixhorned 

  • EDuke32 Developer

#798

View PostSuperthijs, on 14 April 2012 - 07:29 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?

Subtract 100, multiply with 32 (= 4096/128).
0

User is offline   m210® 

#799

Mapster32 and hard-code have a very good command - alignflorslope,but in con-code I must writing:
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

0

User is offline   Fox 

  • Fraka kaka kaka kaka-kow!

#800

I don't know, what exactly alignflorslope does?
0

User is offline   Hendricks266 

  • Weaponized Autism

  #801

View PostM210, on 15 April 2012 - 01:06 PM, said:

Second question - How can I get a level name and show this on display?

qgetsysstr
0

User is offline   m210® 

#802

View PostFox, on 15 April 2012 - 10:31 PM, said:

I don't know, what exactly alignflorslope does?

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.



View PostHendricks266, on 15 April 2012 - 10:37 PM, said:


Thanks a lot <_<

This post has been edited by M210: 15 April 2012 - 11:07 PM

0

User is offline   m210® 

#803

Mapster32:

Quote

Line 139, setvar: sprite structure member `statnum' is read-only.

It's not a read-only value! And I not want to set statnum = 14 manually. What can I do else?
0

Share this topic:


  • 124 Pages +
  • « First
  • 25
  • 26
  • 27
  • 28
  • 29
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic


All copyrights and trademarks not owned by Voidpoint, LLC are the sole property of their respective owners. Play Ion Fury! ;) © Voidpoint, LLC

Enter your sign in name and password


Sign in options