User Tag List

Results 1 to 8 of 8

Thread: Pickup Message script

  1. #1
    Gel
    Join Date
    Jan 2007
    Age
    32
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    685
    Level
    9
    vBActivity - Bars
    Lv. Percent
    24.77%

    Question Pickup Message script

    Please don't insult me, I'm new at this. But can someone tell me what's wrong with this code? It won't compile.
    Code:
    import "std.zh"
    item script SwordMessage
    {
    
    	void run()
    	{
    		void Screen->Message(1)
    	}
    }
    I'm trying to make it display a string which will appear when the player picks up the sword. (I know where to assign it.)

    Please help! I have no idea what I'm doing wrong!

  2. #2
    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,579
    Level
    46
    vBActivity - Bars
    Lv. Percent
    60.36%
    Achievements It's over 9000!

    Re: Pickup Message script

    I know far less than you do, but since it certainly couldn't hurt, ... try removing the "void" from "void Screen->Message(1)" ?

  3. #3
    Administrator DarkDragon's Avatar
    Join Date
    Oct 2001
    Posts
    6,228
    Mentioned
    70 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    11,028
    Level
    31
    vBActivity - Bars
    Lv. Percent
    8.53%

    Re: Pickup Message script

    Yes, that should do it. That first "void" in the documentation means that the function doesn't return anything, and so you can't assign the function to a variable.

    Code:
    int x = Screen->Message(1); //not allowed
    ffc f = Screen->LoadFFC(1); //OK, since LoadFFC has return type ffc.

  4. #4
    Octorok Questions's Avatar
    Join Date
    Nov 2005
    Age
    33
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,275
    Level
    12
    vBActivity - Bars
    Lv. Percent
    18.29%

    Re: Pickup Message script

    I know nearly nothing about scripting in ZC but still this can be done with a single line of code in ZASM

    Code:
    (space)MASGSTRV #
    Where it says (space) it's just one hit of the spacebar. # is the string ID.

  5. #5
    Gel
    Join Date
    Jan 2007
    Age
    32
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    685
    Level
    9
    vBActivity - Bars
    Lv. Percent
    24.77%

    Re: Pickup Message script

    Thanks! I did that before, but it wasn't working because I mistakenly forgot to put a ; at the end.

    Questions: wow, ZASM looks a little simpler. I kinda prefer ZScript, though, because it seems more familiar to me.

    EDIT: Two things:

    1. Link can still move around while the script is displaying. Any way to fix that?
    2. The message stays on screen until you leave, but I think this can be solved by answering question 1.

  6. #6
    Administrator DarkDragon's Avatar
    Join Date
    Oct 2001
    Posts
    6,228
    Mentioned
    70 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    11,028
    Level
    31
    vBActivity - Bars
    Lv. Percent
    8.53%

    Re: Pickup Message script

    There's a quest rule, "Messages Freeze All Action." That will freeze link in place. And yeah, pure ASM can be useful for very short scripts or when you want low-level control of the script, such as direct access to the stack.

  7. #7
    Keese
    Join Date
    Aug 2005
    Posts
    56
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    831
    Level
    10
    vBActivity - Bars
    Lv. Percent
    8.62%

    Re: Pickup Message script

    You would assign the message script to an item's script slot, right?

  8. #8
    Developer
    ZC Developer

    Join Date
    Aug 2006
    Location
    Australia
    Age
    37
    Posts
    2,777
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    6,851
    Level
    25
    vBActivity - Bars
    Lv. Percent
    37.74%

    Re: Pickup Message script

    Quote Originally Posted by ColorPrinter View Post
    2. The message stays on screen until you leave, but I think this can be solved by answering question 1.
    Quest rule: Messages Disappear.

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