User Tag List

Results 1 to 4 of 4

Thread: Declaring a variable...

  1. #1
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,277
    Level
    24
    vBActivity - Bars
    Lv. Percent
    44.02%

    Declaring a variable...

    How exactly do I declare a variable without it referring to anything but a number? Do I use "int (variable name here)", or is there something else I need to do? My script I'm working on has a variable "remainder" that's the end result of the X-position of an FFC divided by 16. How do I declare remainder as a variable?

    Note: Yes, I DID read the ZScript Technical FAQ AND the documentation, but there's nothing in them about declaring variables.

  2. #2
    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.83%

    Re: Declaring a variable...

    Yes. Like;

    int variablename = value

    for decimal numbers;

    float variablename = value

  3. #3
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    32
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,277
    Level
    24
    vBActivity - Bars
    Lv. Percent
    44.02%

    Re: Declaring a variable...

    I alway thought that int and float were used the exact same way... Oh well. I have no idea what number will turn up, so I'll just use float, just to be on the safe side. Thank you!

    Edit: Great... I need to place a Push flag on the FFC, but... ComboF() isn't a function of my pointer.... I put Screen->ComboF(61), because I wanted my FFC to have Flag 61 on it so I could push it. What's going on? I even put the FFC's pointer and = !

    Edit2: Well, this is stupid. Now it's saying that ffc->Flags() is an invalid function for an FFC pointer. Help?
    Edit3: Yay! All I needed to do was change the parentheses to brackets. Now it compiled, so it's time to test!

  4. #4
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,433
    Level
    24
    vBActivity - Bars
    Lv. Percent
    70.17%

    Re: Declaring a variable...

    Technically, int and float are the same in ZScript, but it's a good idea to use them differently so it's clear how the variables are intended to be used.

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