User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 20 of 20

Thread: [2.xx] Custom Global Pointers (The Easy Way)

  1. #11
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,827
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,978
    Level
    33
    vBActivity - Bars
    Lv. Percent
    28.31%
    Yeah, I hear you... Tell you what: I'll put up the script engine sources at some point and you can take a look. Adding something like custom enemy scripts shouldn't be too hard after that.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  2. #12
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,781
    Level
    21
    vBActivity - Bars
    Lv. Percent
    73.06%
    Were you thinking of making a cross-compiler, or providing any kind of bridge between ZScript, and whatever else new you devise?

    I think that not having the ability to use, and integrate both languages, would be an initial detraction from offering a new language. The codebase of what exists in ZScript, is pretty vast, and getting people to shift would be a pain in the arse. If it was possible to utilise both, without everything breaking, that would be brilliant; but I still feel that the main assembly language needs refinement in the future.

    Other than that, would it be horribly difficult to implement the other datatypes at a global scope, as things stand?

  3. #13
    The Time-Loop Continues ZC Developer
    Gleeok's Avatar
    Join Date
    Apr 2007
    Posts
    4,827
    Mentioned
    259 Post(s)
    Tagged
    10 Thread(s)
    vBActivity - Stats
    Points
    12,978
    Level
    33
    vBActivity - Bars
    Lv. Percent
    28.31%
    Oh! You just want to declare pointers at global scope. Never looked at it at all. heh. Probably as easy as a one line fix in the lexer.

    Now finding it and figuring out why they couldn't be declared that way to begin with is another story...


    Quote Originally Posted by ZoriaRPG View Post
    Were you thinking of making a cross-compiler, or providing any kind of bridge between ZScript, and whatever else new you devise?

    I think that not having the ability to use, and integrate both languages, would be an initial detraction from offering a new language. The codebase of what exists in ZScript, is pretty vast, and getting people to shift would be a pain in the arse. If it was possible to utilise both, without everything breaking, that would be brilliant; but I still feel that the main assembly language needs refinement in the future.
    Or (best idea ever!) we put in every possible script language suitable for games and make people learn all of them, one for each type of script!
    Last edited by Gleeok; 06-07-2015 at 06:53 AM.
    This post contains the official Gleeok seal of approval. Look for these and other posts in an area near you.

  4. #14
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,781
    Level
    21
    vBActivity - Bars
    Lv. Percent
    73.06%
    Heh. That would be awesome. Too bad it's as far from practical as possible; but yes, I would like to declare the following at global scope:

    lweapon (importance: very high)
    eweapon (importance: very high)
    npc (importance moderate, may be tricky?)
    ffc (Importance, high, but may be too difficult)

    I don't think that I missed a datatype.

    That way, I can make code to use them from anywhere, as pseudo- self-defined pointers.

    If you could add that, it would be fantastic.

    On a side note, when you think that the latest experimental build will be public (or at least, when might I try it), as I would love to test some of the bugfixes, and the new script error reporting.

  5. #15
    Here lies mero. Died by his own dumbassitude.
    Join Date
    May 2011
    Posts
    929
    Mentioned
    102 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    5,527
    Level
    23
    vBActivity - Bars
    Lv. Percent
    13.96%
    @Gleeok

    I've been looking at the zasm and zscript code anyways. Might as well do it I guess.

  6. #16
    Username Kaiser SUCCESSOR's Avatar
    Join Date
    Jul 2000
    Location
    Winning.
    Age
    38
    Posts
    4,436
    Mentioned
    152 Post(s)
    Tagged
    7 Thread(s)
    vBActivity - Stats
    Points
    10,582
    Level
    30
    vBActivity - Bars
    Lv. Percent
    54.36%
    Quote Originally Posted by Saffith View Post
    I am actually leaning toward Angelscript, but I haven't tried doing much with it yet. Just seems a bit premature, y'know? I've got some ideas, but I don't know to what degree it will work the way I want it to.
    I haven't used AngelScript but I like the look of it and hear good things. I forget why Gleeok ditched it for his game. On a related note I imagine implementing C# isn't going to happen Been really liking C# in Unity. A more capable language is all I am interested in. Really the true kicker is better integration which I imagine is a nightmare.

    Tamamo didn't like my idea to strip out everything but the core of ZC and rework it.

  7. #17
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,781
    Level
    21
    vBActivity - Bars
    Lv. Percent
    73.06%
    Quote Originally Posted by SUCCESSOR View Post
    I haven't used AngelScript but I like the look of it and hear good things. I forget why Gleeok ditched it for his game. On a related note I imagine implementing C# isn't going to happen Been really liking C# in Unity. A more capable language is all I am interested in. Really the true kicker is better integration which I imagine is a nightmare.

    Tamamo didn't like my idea to strip out everything but the core of ZC and rework it.
    C# is under consideration for ZC3, but then again, so is everything else.

    I read some of the AngelScript docs, and the C++/C cross-modes are a fantastic feature. It should be possible to retain compatibility with ZScript, and make object-oriented instructions using it as a base.

  8. #18
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,781
    Level
    21
    vBActivity - Bars
    Lv. Percent
    73.06%
    I just want to bring this up again:

    As pointers are ints, is there any reason that making them legal at a global scope would require a save file format or quest file format change? If not, perhaps getting this minor change into the next update would be good. AFAIK, the only reason this doesn't work, is because a compiler directive actively prevents it (i.e. the declaration).

  9. #19
    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,452
    Level
    24
    vBActivity - Bars
    Lv. Percent
    73.21%
    There is one concern with that. After saving a global pointer and reloading, it's not unlikely that at some point, the ID would come up again and the pointer would appear valid. It obviously wouldn't refer to the same object, which is bad enough, but it might not even be the same type, in which case it could crash the game. We don't have a means of detecting which global variables are pointers in order to reset them when they're saved.
    I'm not certain, but it might also take a bigger change to the compiler. It would have to be able to load gdXXX into a reference register, which currently never happens. I'm not sure it would know how to do that.

  10. #20
    The Timelord
    QDB Manager
    ZC Developer

    Join Date
    Oct 2006
    Location
    Prydon Academy
    Posts
    1,396
    Mentioned
    112 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    4,781
    Level
    21
    vBActivity - Bars
    Lv. Percent
    73.06%
    Hmm... I'm somewhat saddened, but ZC + memory handling aren't exactly a happy coupling. I would have expected that a pointer that is in use, couldn't be reissued, and would be passed over for the next legal value.

    How is detection of array pointers, for global arrays handled? I'd think that would carry over to handling other objects, but IDK. I suspect they're handled differently on the stack, then; or is it that array pointers are assigned at declaration, and ffc/weapon/etc pointers at initialisation? No, they can't be at init, they must be at decl, but if they're just raw ints....sigh.

    Is it possible to manually typecast from an object type to int, to read its pointer, and then back again? Being able to do that would at least help, as it'd make it possible to make global functions to use a typed object declared in a script, from anywhere else.

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 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