User Tag List

Results 1 to 10 of 115

Thread: AngelScript: The Revenge

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #21
    Keese
    ZC Developer

    Join Date
    Jan 2007
    Age
    35
    Posts
    52
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    vBActivity - Stats
    Points
    796
    Level
    9
    vBActivity - Bars
    Lv. Percent
    89.24%
    I just wanted to mention that I picked up the array thing from reading through ghost.zh. So, blame Saffith.

    Of course, seeing that ghost uses it, you'd end up breaking quite a lot of things if you don't support it.

    The heart of the problem is that ZScript treats int and int[] as the same thing. You can do the same trick for the other types as well, but I don't know of anybody doing that.

    If we end up compiling ZScript to AS (still not sure what the exact plan is), it shouldn't be too hard to fix. Just treat ZScript's arrays as their own "thing", separate from actual AS arrays. Just keep a table of them, and look them up anytime you do an array dereference. So, just compile them to eg. ZS_Array_Get(int id, int index) and similar instead of actual array references.

    If we're having ZScript and AS side by side, it's a non-issue. If we want ZScript and AS to be able to interact with each other - well, that was gonna be a mess anyway.

    Edit: relevant section of ghost.zh:
    CODE: Show
    // Remember all the global variables

    // Initializing the array is faster than setting it up afterward...
    // but the difference is probably negligible, realistically
    float tempGhostData[24] = {
    Ghost_X, // 0
    Ghost_Y, // 1
    Ghost_Z, // 2
    Ghost_Jump, // 3
    Ghost_Vx, // 4
    Ghost_Vy, // 5
    Ghost_Ax, // 6
    Ghost_Ay, // 7
    __Ghost_PrevX, // 8
    __Ghost_PrevY, // 9
    Ghost_CSet, // 10
    Ghost_Dir, // 11
    Ghost_Data, // 12
    Ghost_TileWidth, // 13
    Ghost_TileHeight, // 14
    __Ghost_Flags, // 15
    __Ghost_Flags2, // 16
    __Ghost_InternalFlags, // 17
    __Ghost_FlashCounter, // 18
    __Ghost_KnockbackCounter, // 19
    Ghost_HP, // 20
    __Ghost_XOffsets, // 21
    __Ghost_YOffsets // 22
    // 23 is for either drawingData or tempGhostAdditionalCombos;
    // update DrawGhostFFCs if that changes
    };
    int tempGhostAdditionalCombos[21]; // Same size as __Ghost_AdditionalCombos
    // Change it in the loop below, too
    if(__Ghost_AdditionalCombos[0]>0)
    {
    for(int i=0; i<21; i++)
    tempGhostAdditionalCombos[i]=__Ghost_AdditionalCombos[i];
    }

    // Give ghost an array pointer so its data can be found by other scripts
    if(ghost->isValid())
    ghost->Misc[__GHI_NPC_DATA]=0x10000|tempGhostData;


    Last edited by Grayswandir; 02-03-2017 at 11:17 AM.

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