Jump to content

Photo

Get off raft flag


  • Please log in to reply
14 replies to this topic

#1 James24

James24

    Adept

  • Banned
  • Real Name:James
  • Location:Australia

Posted 07 March 2012 - 09:22 PM

Hi.

I will be the first to admit I know absolutely nothing about scripting - except that it can do many miracles.

I need a custom flag that stops link when he is on the raft and returns him to the normal walking mode - just like when he ordinarily stops when there are no more flag 8's in a raft path. The only difference is that even if there are rafting flags (8 and 12) adjacent to this flag Link should not continue rafting to them. He simply gets off his raft and starts walking again.

If this isn't asking for too much from anyone, can anyone help me out? If it is asking too much can someone tell me that what I'm asking for is too much,it would take forever and that I shouldn't bother with this idea?

I have started reading Saffith's basic scripting tutorial and my head hurts icon_frown.gif

Many thanks.

#2 tox_von

tox_von

    Zelda Addict

  • Members
  • Real Name:Redgor
  • Location:Toxicville , Simcity

Posted 07 March 2012 - 11:56 PM

did you see the controllable raft topic here?

http://www.purezc.co...showtopic=53765

#3 James24

James24

    Adept

  • Banned
  • Real Name:James
  • Location:Australia

Posted 08 March 2012 - 12:08 AM

Yes I did, but the point is not to make the raft controllable (in fact that would ruin everything if the player got control of the raft), simply to get him off the raft. And, when he gets off the raft he shouldn't be able to get back on the raft without going to a dock.

Edited by James24, 08 March 2012 - 12:10 AM.


#4 Moosh

Moosh

    Tiny Little Questmaker

  • ZC Developers

Posted 08 March 2012 - 12:54 AM

In theory it should be easy. Assuming Zelda Classic counts rafting as one of Link's actions, you could have a script that changes his action to walking when he hits the flag. I won't be able to try it until tomorrow, though.

#5 James24

James24

    Adept

  • Banned
  • Real Name:James
  • Location:Australia

Posted 08 March 2012 - 01:12 AM

Thanks Poke. Take your time.

#6 tox_von

tox_von

    Zelda Addict

  • Members
  • Real Name:Redgor
  • Location:Toxicville , Simcity

Posted 08 March 2012 - 01:29 AM

rafting is an action

const int LA_RAFTING = 6;

was the idea to change the action to

const int LA_WALKING = 1;

i dont know how to make it a flag but it could be an ffc.

i couldnt change linkaction rafting to walking with code there might be a way to do if item using = raft and distance =<5.

Edited by tox_von, 08 March 2012 - 02:05 AM.


#7 James24

James24

    Adept

  • Banned
  • Real Name:James
  • Location:Australia

Posted 08 March 2012 - 02:22 AM

I've seen Russ do it before with his Somewhere in between quest. He had a Custom Flag (100) and when he put that on water tiles they turned into ice when an ice beam passed over. There are flags marked "General Purpose scripts" (98-102) so it must indicate that its possible to make a scripted flag. But hey, if a ffc works then that's cool.

Thanks for the help guys and if it works, I'll send you a special Liberation Quest version with a very interesting rafting section as a token of my appreciation.

#8 tox_von

tox_von

    Zelda Addict

  • Members
  • Real Name:Redgor
  • Location:Toxicville , Simcity

Posted 08 March 2012 - 02:26 AM

putting a combo flag on a ffc might do it.

#9 James24

James24

    Adept

  • Banned
  • Real Name:James
  • Location:Australia

Posted 08 March 2012 - 03:25 AM

The thing about the ffc is that its only available at one place on the screen at a given time. This introduces new restrictions.

I looked at Russ's script file and from what I can tell the thing that acts on the flags is a global function inside a while(true) loop that runs every frame. He uses
screen->comboi to get the flag ID and then an if statement to decide how to change things.

Edited by James24, 08 March 2012 - 03:42 AM.


#10 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 08 March 2012 - 03:39 AM

The script doesn't seem like it would be too hard to right. I don't have time to write it myself, but I can help out whoever does write it. Like James said, I used the general purposes flags in Somewhere in Between for combos that reacted to the fire and ice beams. The setup for that's really easy. You just use Screen->ComboI. For instance, you might say "int com = Screen->ComboI[ComboAt(Link->X, Link->Y)]". Then, check if com == 98 (or whatever other flag you want). If it is, and if Link->Action == 6 (rafting), set Link->Action to 1 (walking). Actually, ya know what.

CODE
int raftyflag = 98; //Set this to whatever flag you want to be the "Get off raft flag"

ffc script RaftEnd {
    void run() {
        while(true) {
            int com = Screen->ComboI[ComboAt(Link->X, Link->Y)];
            if (com == raftyflag && Link->Action == 6) {
                Link->Action = 1;
            }
                Waitframe();
        }
    }
}


Okay, that wasn't actually too hard. I haven't tested it in the player, but it compiles fine, and I don't see any reason why it shouldn't work. Just set the number at the top to whatever flag you want to be the "Get off raft" flag, and you're good to go.

Edit: Oh right! Make you sure you assign that script to a FCC on the screen. You don't have to put the FFC anywhere, just set it to a blank FFC that isn't combo 0 on every screen you want the flag to work on.

#11 James24

James24

    Adept

  • Banned
  • Real Name:James
  • Location:Australia

Posted 08 March 2012 - 04:34 AM

Thanks Russ. I'll test it out now.

Hmm...doesn't work because the normal rafting flags (8 and 12) don't recognize that as part of the raft path and hence won't send Link there. If those flags don't recognize it then the only way to get around that problem would be to design custom rafting flags. There goes that idea then.

Edited by James24, 08 March 2012 - 04:57 AM.


#12 Russ

Russ

    Caelan, the Encouraging

  • Administrators
  • Location:Washington

Posted 08 March 2012 - 05:21 AM

Can't you place flag 8 or 12 on the combo normally and make flag 98 an inherent flag?

#13 James24

James24

    Adept

  • Banned
  • Real Name:James
  • Location:Australia

Posted 08 March 2012 - 05:34 AM

That's very clever! Why didn't I think of that? I gtg now, but first chance I get I'll try it.

#14 tox_von

tox_von

    Zelda Addict

  • Members
  • Real Name:Redgor
  • Location:Toxicville , Simcity

Posted 08 March 2012 - 07:06 AM

the code above seems to work already when i tried it.

#15 James24

James24

    Adept

  • Banned
  • Real Name:James
  • Location:Australia

Posted 08 March 2012 - 08:32 AM

Yep the code works! Thanks a million to everyone who pitched in to help me. I'll send you a PM when I've updated my quest so you can see its creative use.


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users