User Tag List

Page 3 of 3 FirstFirst 1 2 3
Results 21 to 24 of 24

Thread: Don't look now, but build 1000 is nearing...

  1. #21
    Lynel
    ZC Developer
    pkmnfrk's Avatar
    Join Date
    Jan 2004
    Location
    Toronto
    Age
    37
    Posts
    1,248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,141
    Level
    18
    vBActivity - Bars
    Lv. Percent
    10.34%

    Re: Don't look now, but build 1000 is nearing...

    Well, because in C, the language ZScript is based off of, we do this:

    Code:
    mystruct foo; //doesn't really matter what this is, exactly
    
    foo.x = 1; //set the x member of foo to 1
    
    mystruct* fooptr = &foo; //take a pointer to foo. Remember: fooptr == foo
    
    printf("foo.x: %d", fooptr->x); //prints "foo.x: 1"
    With a normal struct (UDT, class, whatever), you get to use the dot operator, like in BASIC and other languages. However, when you add a pointer into the mix, then you need to tell the computer "I want to deal with the object being pointed at, not the pointer itself". So, you get to use the dereferencing operator instead.
    Tale of the Cave - a web comic - Updates Monday, Wednesday, Friday
    ZC Tutorials - Tutorials and Script Library - Updated July 30, 2008
    ZeldaGuard - Corruption in my save files? It's more likely than you think!
    I do script requests!

  2. #22
    Gibdo beefster09's Avatar
    Join Date
    Mar 2006
    Age
    31
    Posts
    699
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    2,709
    Level
    16
    vBActivity - Bars
    Lv. Percent
    97.13%

    Re: Don't look now, but build 1000 is nearing...

    I once thought that a period would be nicer to use, but the dereferencing operator is much less ambiguous, more accurate to the parent language, and easier on the compiler.

    The only advantage to the somewhat ambiguous period is that it takes fewer keystrokes. It would make perfect sense if ZC used, say, Python for scripting.

    On the other hand, I can't really site an instance when one would use the dot operator. As far as I know, ZScript doesn't have structs.
    Avatar: Just who the SPAAAACE do you think I am?

  3. #23
    Lynel Revfan9's Avatar
    Join Date
    Jun 2005
    Location
    In front of a screen. I never leave.
    Age
    31
    Posts
    1,160
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,389
    Level
    18
    vBActivity - Bars
    Lv. Percent
    70.83%

    Re: Don't look now, but build 1000 is nearing...

    Quote Originally Posted by pkmnfrk View Post
    Well, because in C, the language ZScript is based off of, we do this:

    Code:
    mystruct foo; //doesn't really matter what this is, exactly
    
    foo.x = 1; //set the x member of foo to 1
    
    mystruct* fooptr = &foo; //take a pointer to foo. Remember: fooptr == foo
    
    printf("foo.x: %d", fooptr->x); //prints "foo.x: 1"
    With a normal struct (UDT, class, whatever), you get to use the dot operator, like in BASIC and other languages. However, when you add a pointer into the mix, then you need to tell the computer "I want to deal with the object being pointed at, not the pointer itself". So, you get to use the dereferencing operator instead.
    ZScript has structs? When did this happen? I've never seen pointers anywhere in any ZScript I've ever looked over either, at least not as I've grown to know them.

    Maybe I don't know what I'm talking about, as I'm no expert on C, but nothing should ever be followed off of a cliff. When mimicking C precisely becomes more important than making a usable language, you have a problem.

  4. #24
    Lynel
    ZC Developer
    pkmnfrk's Avatar
    Join Date
    Jan 2004
    Location
    Toronto
    Age
    37
    Posts
    1,248
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    3,141
    Level
    18
    vBActivity - Bars
    Lv. Percent
    10.34%

    Re: Don't look now, but build 1000 is nearing...

    No, ZC doesn't have structs (although, that would be made of awesome. But, finish strings first!).

    However, it does have pointers, if not the same was as in C. All those "ffc"s and "npc"s and "item"s and stuff we like throwing around are "pointers" to the underlying objects. The fact that we can reassign what a given variable points at is a clue. ("Link" and "Screen" and stuff are pointers too, but since there's only one of those, you can't reassign them.)
    Tale of the Cave - a web comic - Updates Monday, Wednesday, Friday
    ZC Tutorials - Tutorials and Script Library - Updated July 30, 2008
    ZeldaGuard - Corruption in my save files? It's more likely than you think!
    I do script requests!

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