User Tag List

Page 3 of 5 FirstFirst 1 2 3 4 5 LastLast
Results 21 to 30 of 50

Thread: Scripting Power!

  1. #21
    Developer
    ZC Developer
    jman2050's Avatar
    Join Date
    Jun 2001
    Location
    Do you really need to know
    Age
    37
    Posts
    3,883
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    5,709
    Level
    23
    vBActivity - Bars
    Lv. Percent
    46.14%

    Re: Scripting Power!

    Indeed, you can set projectiles to go at an angle. zscript.txt sort of touches on it, but basically if the Angular property is set to true, then Dir will be overridden by the angle attribute. The projectile will then move in that direction. Think of the normal fireball projectile that statues shoot. The only difficulty is that you're going to have to convert the normal degrees to Radians. Fortunately, this is as simple as going radians = degrees * (PI/180); but if you forget to do that before setting the lweapon angle it can be bad.
    AGN's Resident Zelda Classic Developer and Sonic the Hedgehog Fanboy

  2. #22
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,958
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.18%

    Re: Scripting Power!

    Ha! I just put your reworked script engine through a rigorous workout. I'll spare you the details, but I had DrawTiles, 180 enemies being controlled by 32 ffc's, and tons of weapon sprites being thrown around. Got 60fps on my crappy pentium III 900mhz 512ram machine. And, no bugs so far. O_o. Great work!


    Quote Originally Posted by jman2050 View Post
    Indeed, you can set projectiles to go at an angle. zscript.txt sort of touches on it, but basically if the Angular property is set to true, then Dir will be overridden by the angle attribute. The projectile will then move in that direction. Think of the normal fireball projectile that statues shoot. The only difficulty is that you're going to have to convert the normal degrees to Radians. Fortunately, this is as simple as going radians = degrees * (PI/180); but if you forget to do that before setting the lweapon angle it can be bad.

    Fooey, I suppose I needed a crash course in radians sooner than later. ;p ..Ok, so for example: To script an enemy weapon attack that fires off 36 sprites in a circular pattern, how would one go about that...

    Set eweapon->Step;
    Set eweapon->Angular=true;
    Set eweapon->Damage=d;
    Set eweapon->Angle= Rad ? (deg*(PI/180)? ...then increment 10 for deg each sprite..

    Or would I need Angle=RadianSin(//?);Angle=RadianCos..nuts..it's like cryptonite to me...


    in other words, have no idea how to set Angle. :/
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  3. #23
    Developer
    ZC Developer
    jman2050's Avatar
    Join Date
    Jun 2001
    Location
    Do you really need to know
    Age
    37
    Posts
    3,883
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    5,709
    Level
    23
    vBActivity - Bars
    Lv. Percent
    46.14%

    Re: Scripting Power!

    eweapon->Angle = deg*(PI/180) should do fine.

    Ha! I just put your reworked script engine through a rigorous workout. I'll spare you the details, but I had DrawTiles, 180 enemies being controlled by 32 ffc's, and tons of weapon sprites being thrown around. Got 60fps on my crappy pentium III 900mhz 512ram machine. And, no bugs so far. O_o. Great work!
    Excellent. This is exactly the type of feedback I'm hoping for.

    Also, a new episode coming soon. Something a bit less proof-of-concept

    EDIT - Actually, just realized there was a bug with the assignment of angle in the engine. It'll be fixed in the next beta. Sorry :/
    AGN's Resident Zelda Classic Developer and Sonic the Hedgehog Fanboy

  4. #24
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,958
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.18%

    Re: Scripting Power!

    Cool, Thanks.

    Also I found something with eweapons; Passing something like WPN_ENEMYFIREBALL or others into CreateEWeapon() doesn't display the right graphic. They all seem to use Tile->0.....lweapons seem fine though from what i've tried. Figured you're still ironing this stuff out, but just in case you don't know, well here it is.


    ..And did I mention: wow, holy shit man.


    edit:
    Quote Originally Posted by russadwan
    Dang, I can't view that webpage. Could someone please tell me what happened?
    Ahahaha! I must of missed that earlier.
    Dude, did your web browser come in a box with a picture of an angry nun smacking her hand with a ruler or something?
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  5. #25
    Developer
    ZC Developer
    jman2050's Avatar
    Join Date
    Jun 2001
    Location
    Do you really need to know
    Age
    37
    Posts
    3,883
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    5,709
    Level
    23
    vBActivity - Bars
    Lv. Percent
    46.14%

    Re: Scripting Power!

    Quote Originally Posted by Gleeok View Post
    Cool, Thanks.

    Also I found something with eweapons; Passing something like WPN_ENEMYFIREBALL or others into CreateEWeapon() doesn't display the right graphic. They all seem to use Tile->0.....lweapons seem fine though from what i've tried. Figured you're still ironing this stuff out, but just in case you don't know, well here it is.


    ..And did I mention: wow, holy shit man.
    Yeah, that's because the constants in std.zh aren't correct for this assignment. Like I said, the ZC engine is kinda screwy regarding weapons. If you want to pass an existing weapon type into the engine, use these. I just copied the enumeration from the code for the time being

    Code:
    enum
    {
      wNone,wSword,wBeam,wBrang,wBomb,wSBomb,wLitBomb,wLitSBomb,wArrow,
      wFire,wWhistle,wBait,wWand,wMagic,wCatching,wWind,wRefMagic,wRefFireball,wRefRock,
      wHammer, wHookshot,
      wHSHandle, wHSChain, wSSparkle, wFSparkle,
      wSmack, /* wGArrow, */ wPhantom, wCByrna, wRefBeam, wStomp, lwMax,
      wEnemyWeapons=128,
      ewFireball,ewArrow,ewBrang,ewSword,ewRock,ewMagic,ewBomb,ewSBomb,
      ewLitBomb,ewLitSBomb,ewFireTrail,ewFlame,ewWind,ewFlame2,ewFlame2Trail,
      ewIce,ewFireball2, wMax
    };
    For reference, what this enum keyword means is that the first value in the list is 0 and all values after that are incremented by 1. So if 2None is 0, wSword would be 1, wBeam 2, wSBomb 5, etc. This changes when you get to the EnemyWeapons. As you can see, wEnemyWeapons is 128. That isn't actually used by the engine, it's just a marker. From there, ewFireball is 129, ewArrow is 130, etc etc.

    So for your fireballs, you want to use the number 129 for that purpose. New constants should be included in std.zh for the next version.
    AGN's Resident Zelda Classic Developer and Sonic the Hedgehog Fanboy

  6. #26
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,611
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.87%

    Re: Scripting Power!

    So are fully aim-able projectiles implemented in 758?

    EDIT: Where does the angle of an enemy projectile measure from? That is, which way does an angle of 0 go? And does the angle measure clockwise or counterclockwise?

  7. #27
    Developer
    ZC Developer
    jman2050's Avatar
    Join Date
    Jun 2001
    Location
    Do you really need to know
    Age
    37
    Posts
    3,883
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    5,709
    Level
    23
    vBActivity - Bars
    Lv. Percent
    46.14%

    Re: Scripting Power!

    The angle's origin is directly to the right of center. For Angle, as usual, the angle progresses clockwise. However, for some reason, Allegro needs the angles in the Arc function counterclockwise. Go figure that one out.

    Also, part 2!

    http://www.youtube.com/watch?v=XAGlpcxbhsU

    As you can see, I went a little less 'tease' this time around Lots and lots of crap in this script, and writing it has helped me to see a few of the deficiencies in the current engine model. Hopefully they can be addressed as ZC 2.5 comes closer to completion. Also, you all get a quest file and the scripts to look at!... after the next beta is released, which this was done on to address a few annoying bugs that interfered with the scripting.

    Next time I'm hoping to get a bit more down and dirty with the primitive drawing functions.
    AGN's Resident Zelda Classic Developer and Sonic the Hedgehog Fanboy

  8. #28
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,611
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.87%

    Re: Scripting Power!

    Hahahaha

    That was awesome, Jman! Truly bad-ass. I really, REALLY like the boss death animation. Much better than mine. And the boss entry setup was really slick.

    Way to put us lowly scripters in our place!

    EDIT: I'm having trouble getting the projectiles to DO anything. Is Step a variable like Vx or Vy that will automatically apply itself each frame? Or do we have to move it manually with our script (that is, read Step and move it at Angle ourselves because the engine isn't doing jack?)

  9. #29
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,826
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,958
    Level
    33
    vBActivity - Bars
    Lv. Percent
    26.18%

    Re: Scripting Power!

    F'ing shit. Amazing stuff Jman. But wait, Are you saying that you made the aquamentus about 3x3 via a drawtile? ..And how the hell did you get that awesome intro to work? ....wow. I salute you sir.



    Quote Originally Posted by C-Dawg View Post

    EDIT: I'm having trouble getting the projectiles to DO anything. Is Step a variable like Vx or Vy that will automatically apply itself each frame? Or do we have to move it manually with our script (that is, read Step and move it at Angle ourselves because the engine isn't doing jack?)
    Here's some stuff I messed around with. Works great for the most part. Really neat stuff:

    Code:
    ffc script eweap_test{
    
    	void run(){
    
    		int attack_delay;
    
    		while(true){
    
    			Waitframe();
    			int tx = this->X; int ty = this->Y;
    
    			if(attack_delay>0)attack_delay--;
    
    			else{
    				eweapon laser = Screen->CreateEWeapon(129);
    				laser->X=tx;laser->Y=ty+8;
    				laser->Dir=1;laser->Step=4;
    				laser->Damage=2;
    				laser->CSet=0;
    				attack_delay=3;
    			}
    		}
    	}
    }
    Code:
    					eweapon laser;
    					laser = Screen->CreateEWeapon(129);
    					laser->X=tx;laser->Y=ty;laser->Step=2;laser->Damage=2;laser->CSet=0;
    					laser->Angular=true;laser->Angle = 90*(PI/180);
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  10. #30
    Wizrobe C-Dawg's Avatar
    Join Date
    Jan 2002
    Posts
    4,205
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,611
    Level
    24
    vBActivity - Bars
    Lv. Percent
    99.87%

    Re: Scripting Power!

    It's not working that way, though. Whether I use Fireball's number, or some new number for a dummy weapon, I set Step to something... and no reaction.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social