Jump to content

Photo

Fire/Ice Arrow Script


  • Please log in to reply
19 replies to this topic

#1 Alestance

Alestance

    Saint Alestance - Eliminator of the ZGP format

  • Members
  • Real Name:Lonk
  • Location:Pennsylvania

Posted 05 March 2009 - 10:05 AM

Except by not as difficult as it sounds, I mean I can't do it myself. icon_wink.gif

The low-down: I have two level 2 arrows, Fire Arrow and Ice Arrow.(Light Arrow is level 3 so it doesn't matter icon_razz.gif) They both trigger Level 2 Arrow flags, which is good because I want them to. However, I also want them to trigger individual flags. For example, Flag 100 could be something you can burn with the fire arrow, and 101 for something you can freeze. I plan to have a lot of those kinds of puzzles in the game, so, help me out?

#2 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 06 March 2009 - 01:24 AM

Try this:

CODE

item script EnchantArrow{
    void run(int wtype, int wdam, int wspeed, int wcset, int wtile){

        lweapon l;
        l = Screen->CreateLWeapon(wtype);
        l->X=Link->X;l->Y=Link->Y;
        l->Step=wspeed;
        l->Damage=wdam;
        if(wcset>0)l->CSet=wcset;
        if(wtile>0)l->Tile = wtile;
        laser->Dir = Link->Dir;
    }
}

D[]vars:
type; Important to set this. Look in std.zh for lweapon values.
damage.
speed. (100 - 700 recommended)
cset(optional- no need to set)
tile(optional- no need to set)

Edited by Gleeok, 06 March 2009 - 01:27 AM.


#3 Alestance

Alestance

    Saint Alestance - Eliminator of the ZGP format

  • Members
  • Real Name:Lonk
  • Location:Pennsylvania

Posted 06 March 2009 - 04:37 AM

No, thats not exactly what I want. I don't need a script to make the ARROW work. I need a script that will make both arrows trigger individual flags.

#4 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 06 March 2009 - 07:24 AM

Well I was thinking that if you mask the arrow with another weapon type it would trigger any of the appropriate flags automatically using either of the fired weapons flag checks or whatever.

So it sounds like you want custom flags?
Is this possible, and if so, would someone mind explaining how to do it?

#5 Joe123

Joe123

    Retired

  • Members

Posted 06 March 2009 - 10:12 AM

Check for a custom flag (so 98 or whatever), then if you hit it, trigger the screen secrets (Screen->State[SS_SECRET] = true).

Though you'd have to look up the proper array entry in std.zh cause I just made that one up.

#6 Alestance

Alestance

    Saint Alestance - Eliminator of the ZGP format

  • Members
  • Real Name:Lonk
  • Location:Pennsylvania

Posted 06 March 2009 - 12:28 PM

Scratch that. It looks like I have to make some adjustments.

Fire arrow is level 3 now, but I want to prevent it from activating level 2 secrets. Light arrow is level 4, but I want it to activate its own secret flag, but not activate level 2 and 3 secrets.(level 1 is fine, since its the unenchanted arrow.)

#7 Joe123

Joe123

    Retired

  • Members

Posted 06 March 2009 - 05:13 PM

It's not that easy I'm afraid.

#8 Alestance

Alestance

    Saint Alestance - Eliminator of the ZGP format

  • Members
  • Real Name:Lonk
  • Location:Pennsylvania

Posted 06 March 2009 - 07:16 PM

And me without my map and compass. icon_sweat.gif

Is there anything you can do?

Edited by Alestance, 06 March 2009 - 07:17 PM.


#9 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 11 March 2009 - 01:15 AM

QUOTE(Alestance @ Mar 6 2009, 04:16 PM) View Post

Is there anything you can do?


Of course. First I'd give each weapon a unique "identifier", such as a certain tile that only that weapon uses. Then decide which flags to use for them. Secondly, it's going to be in a global script.

That should be the only requirements I need.


..if you still need it that is.

#10 Alestance

Alestance

    Saint Alestance - Eliminator of the ZGP format

  • Members
  • Real Name:Lonk
  • Location:Pennsylvania

Posted 12 March 2009 - 02:34 PM

I don't necessarily NEED it, but yea.

Explain Unique Identifier, though.

#11 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 13 March 2009 - 12:33 AM

Something unique for each weapon that is accessible via scripts. What I like to do is give them different tiles, even if they use the same graphic. Just copy/paste them in the tile page and make sure only one weapon uses that tile/tiles. Simple no?

Also I'd like to do this in one shot, so list any and every custom weapon flag you want to be able to trigger by link weapons. (Or I could just make 5 dummy slots and you could fill them in later.)


There is still one problem. There is no SS_SECRETS = true type flag, so I'm still waiting for someone to help me out with that.

QUOTE
//Screen states. Use these with Screen->State[], etc.

const int ST_DOORUP = 0; // The locked/bomb door has been permanently unlocked/bombed
const int ST_DOORDOWN = 1; // The locked/bomb door has been permanently unlocked/bombed
const int ST_DOORLEFT = 2; // The locked/bomb door has been permanently unlocked/bombed
const int ST_DOORRIGHT = 3; // The locked/bomb door has been permanently unlocked/bombed
const int ST_SECRET = 13; // Screen Secrets have been made permanent
const int ST_ITEM = 4; // If set, the item is gone
const int ST_SPECIALITEM = 5; // If set, the Cave/Item Cellar/Dive For Item/Armos item is gone
const int ST_ENEMYNORETURN = 6; // If set, enemies won't return
const int ST_TEMPNORETURN = 7; // If set, enemies won't return. This is automatically unset when you leave the DMap
const int ST_LOCKBLOCK = 8; // The lock block on the screen has been triggered
const int ST_BOSSLOCKBLOCK = 9; // The boss lock block on the screen has been triggered
const int ST_CHEST = 10; // The unlocked chest on this screen has been opened
const int ST_LOCKEDCHEST = 11; // The locked chest on this screen has been opened
const int ST_BOSSCHEST = 12; // The boss chest on this screen has been opened
const int ST_VISITED = 14; // If set, this screen will appear on the Overworld Map


There is ST_SECRET, but that just makes them permanent, and there doesn't seem to be one that actually can TRIGGER secrets.

#12 Joe123

Joe123

    Retired

  • Members

Posted 13 March 2009 - 09:50 AM

Oh.

CODE
Screen->State[ST_SECRET] = true;
Link->PitWarp(Game->GetCurDMap(),Game->GetCurScreen());


Obviously 'Full Screen Warp' or whatever it's called nowadays might be something you want checked.

#13 Gleeok

Gleeok

    It's dangerous to dough alone, bake this.

  • Members
  • Real Name:Pillsbury
  • Location:Magical Land of Dough

Posted 13 March 2009 - 08:06 PM

That's actually pretty retarded if you think about it. Could be doable if there was a function to enable/disable fullscreen warp, but seriously, why is there not a Screen->Secrets = true flag? Probably an oversight thing, but really, c'mon meow.



I don't think anybody would want to use this code:
CODE
global script slotno2
{
    void run()
    {
        int d;
        while(true)
        {
            if(Link->InputL && d == 0) {
                Screen->State[13] = true;
                Link->PitWarp(Game->GetCurDMap(),Game->GetCurScreen());
                d = 15;
            }
            Waitframe();
            if(d > 0) d--;
        }
    }
}


#14 Joe123

Joe123

    Retired

  • Members

Posted 14 March 2009 - 06:02 AM

QUOTE(Gleeok @ Mar 14 2009, 01:06 AM) View Post
I don't think anybody would want to use this code:
CODE
global script slotno2
{
    void run()
    {
        int d;
        while(true)
        {
            if(Link->InputL && d == 0) {
                Screen->State[13] = true;
                Link->PitWarp(Game->GetCurDMap(),Game->GetCurScreen());
                d = 15;
            }
            Waitframe();
            if(d > 0) d--;
        }
    }
}


Why write it then? icon_eek.gif


I'll add it to my list of 'things I might try adding to ZScript'.

#15 Alestance

Alestance

    Saint Alestance - Eliminator of the ZGP format

  • Members
  • Real Name:Lonk
  • Location:Pennsylvania

Posted 14 March 2009 - 07:22 AM

QUOTE(Gleeok @ Mar 13 2009, 01:33 AM) View Post

Something unique for each weapon that is accessible via scripts. What I like to do is give them different tiles, even if they use the same graphic. Just copy/paste them in the tile page and make sure only one weapon uses that tile/tiles. Simple no?

Also I'd like to do this in one shot, so list any and every custom weapon flag you want to be able to trigger by link weapons. (Or I could just make 5 dummy slots and you could fill them in later.)
There is still one problem. There is no SS_SECRETS = true type flag, so I'm still waiting for someone to help me out with that.
There is ST_SECRET, but that just makes them permanent, and there doesn't seem to be one that actually can TRIGGER secrets.


I'm still not getting it. icon_sorry.gif


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users