User Tag List

Results 1 to 10 of 10

Thread: Item>String script: What gives?

  1. #1
    Lynel Dart Zaidyer's Avatar
    Join Date
    Apr 2001
    Location
    Rand McNally
    Age
    37
    Posts
    1,943
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,057
    Level
    17
    vBActivity - Bars
    Lv. Percent
    88.95%

    Item>String script: What gives?

    I'm not ashamed to admit this is my first script. The idea is to display a string when Link is holding up an item, like most modern Zelda games. It compiles correctly with all my other scripts, except... nothing happens.

    Code:
    ffc script itemstring {
      void run(int m){
    	Waitframes(5);
    	if (Link->Action == 4) { 
    		Waitframes(5); Screen->Message(m); }
    	if (Link->Action == 5) {
    		Waitframes(5); Screen->Message(m); }
    	}
    }
    What am I doing wrong?
    ~Dart Zaidyer

  2. #2
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,306
    Level
    26
    vBActivity - Bars
    Lv. Percent
    9.15%

    Re: Item>String script: What gives?

    Preferred method:
    Code:
    item script message{
    	void run(int m){
    		Screen->Message(m);
    	}
    }
    Set as the pickup script for the item.

    Yours doesn't work because there's no while loop.

    Fix of your method:
    Code:
    ffc script itemstring{
    	void run(int m){
    		while(Link->Action != 4 && Link->Action != 5) Waitframe();
    		Waitframes(5);
    		Screen->Message(m);
    	}
    }

  3. #3
    Wizrobe
    Join Date
    Dec 2006
    Age
    29
    Posts
    3,693
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    8,938
    Level
    28
    vBActivity - Bars
    Lv. Percent
    43.33%

    Re: Item>String script: What gives?

    Just so you know, your main problem was using waitframe. Item scripts only last for one frame, so waitframe will do nothing, unless put in a while script, like Joe showed. Joe, you really should explain things better. :)
    Quote Originally Posted by rock_nog View Post
    Well of course eveything's closed for Easter - don't you know of the great Easter tradition of people barricading themselves up to protect themselves from the return of Zombie Christ?


  4. #4
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,306
    Level
    26
    vBActivity - Bars
    Lv. Percent
    9.15%

    Re: Item>String script: What gives?

    No, his main problem is that he doesn't have a while loop.
    He's using an ffc script.
    I explained well enough; if he's willing to read through what I put and see how it differs from his it should help him.
    If he wants a more thorough explanation I'm sure he'll ask.

    Russ, you should really read through things better. :)

  5. #5
    Wizrobe
    Join Date
    Dec 2006
    Age
    29
    Posts
    3,693
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    8,938
    Level
    28
    vBActivity - Bars
    Lv. Percent
    43.33%

    Re: Item>String script: What gives?

    I have one thing to say: I feel like an idiot.
    Quote Originally Posted by rock_nog View Post
    Well of course eveything's closed for Easter - don't you know of the great Easter tradition of people barricading themselves up to protect themselves from the return of Zombie Christ?


  6. #6
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,306
    Level
    26
    vBActivity - Bars
    Lv. Percent
    9.15%

    Re: Item>String script: What gives?

    Heh, sorry

  7. #7
    On top of the world ShadowTiger's Avatar
    Join Date
    Jun 2002
    Location
    Southeastern New York
    Posts
    12,231
    Mentioned
    31 Post(s)
    Tagged
    3 Thread(s)
    vBActivity - Stats
    Points
    29,582
    Level
    46
    vBActivity - Bars
    Lv. Percent
    60.52%
    Achievements It's over 9000!

    Re: Item>String script: What gives?

    Damn you guys. :p No wonder scripting is so hard to learn. If it's not problem X interfering with problem Y that we never even heard of, it's that problem Y was situated in context A when context B needs to be related to whereas Context C is just sitting there on the shelf without any reference to the much needed solution to problem Z, which is currently sitting there without a while loop nobody knew to make.

    If that didn't make any sense, then you know what's going on in the minds of those who are trying to script.

    "Where the hell did that come from, and where can I find the book of stuff I need to know later that nobody is telling me now?"

    This is the kind of stuff that "just doing it" doesn't really teach. :-/

  8. #8
    &&
    ZC Developer
    Joe123's Avatar
    Join Date
    Sep 2006
    Age
    33
    Posts
    3,061
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    7,306
    Level
    26
    vBActivity - Bars
    Lv. Percent
    9.15%

    Re: Item>String script: What gives?

    I knew how to make the while loop =S

    If someone wants me to go over things in detail then I'm willing to do so, I just didn't this time.
    I do quite often, I could write a page worth of explanaition on that if you want?

  9. #9
    Keese ScaryBinary's Avatar
    Join Date
    Dec 2006
    Age
    49
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    918
    Level
    10
    vBActivity - Bars
    Lv. Percent
    53.16%

    Re: Item>String script: What gives?

    Maybe we should start a ZScript "Tips and Tricks" page in the Wiki?

    If we can add this kind of stuff to a common place, its easier to find (versus reading through 100's of forum posts here) and we only have to type up the majority of it once....

  10. #10
    a.k.a. Zephlon Arphanosh Mega Link's Avatar
    Join Date
    May 2006
    Age
    31
    Posts
    371
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,673
    Level
    13
    vBActivity - Bars
    Lv. Percent
    73.14%

    Re: Item>String script: What gives?

    Quote Originally Posted by ShadowTiger View Post
    Damn you guys. :p No wonder scripting is so hard to learn. If it's not problem X interfering with problem Y that we never even heard of, it's that problem Y was situated in context A when context B needs to be related to whereas Context C is just sitting there on the shelf without any reference to the much needed solution to problem Z, which is currently sitting there without a while loop nobody knew to make.

    If that didn't make any sense, then you know what's going on in the minds of those who are trying to script.

    "Where the hell did that come from, and where can I find the book of stuff I need to know later that nobody is telling me now?"

    This is the kind of stuff that "just doing it" doesn't really teach. :-/
    You lost me when you said, "situated in context A".

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