Duke4.net Forums: TheZombieKiller - Viewing Profile - Duke4.net Forums

Jump to content

Hide message Show message
Welcome to the Duke4.net Forums!

Register an account now to get access to all board features. After you've registered and logged in, you'll be able to create topics, post replies, send and receive private messages, disable the viewing of ads and more!

Reputation: 273 My posts turn threads into gold
Group:
Members
Active Posts:
302 (0.2 per day)
Most Active In:
Duke Nukem General (92 posts)
Joined:
25-April 13
Profile Views:
6,276
Last Active:
User is offline Yesterday, 06:42 PM
Currently:
Offline

My Information

Age:
Age Unknown
Birthday:
July 7
Gender:
Male Male
Location:
Adelaide, Australia

Contact Information

E-mail:
Click here to e-mail me
Skype:
Skype  bennyboy.m.12

Latest Visitors

Posts I've Made

  1. In Topic: Shadow Warrior - "New Episode"

    21 June 2017 - 05:48 AM

    View Posticecoldduke, on 19 June 2017 - 06:50 AM, said:

    If we can get those models released(if they exist) I'll immediately start working on FBX support in Polymer/Polymost.

    While FBX is decent at best (remember that it's intended for transferring data between Autodesk applications, nothing more) for a one-time import, it's very much a bad idea for the primary skeletal model format in the context of modding, where backwards compatibility is a highly important factor. FBX is a format that has had considerable changes over each iteration, to the point where each version is generally going to be incompatible with any other. I would strongly advise against using it here.

    I'd recommend a more modding-friendly format such as IQM. There are others, but that one's my personal recommendation.
  2. In Topic: Shadow Warrior - "New Episode"

    15 June 2017 - 09:46 PM

    Here are the ambient sounds, too
  3. In Topic: Shadow Warrior - "New Episode"

    15 June 2017 - 08:40 PM

    This would probably work (untested):

    lua_getglobal(L, "sounds");
    if (lua_istable(L, -1))
    {
        lua_pushnil(L);
        while (lua_next(L, -2))
        {
            static int fxid = lua_tointeger(L, -2);
            
            if (lua_istable(L, -1))
            {
                char *name;
                int pri, pitch_lo, pitch_hi,
                    voc_num, voc_dist, voc_flags;
                
                int len = lua_objlen(L, -1);
                for (int i = 1; i <= len; i++)
                {
                    lua_rawgeti(L, -1, i);
                    
                    switch (i)
                    {
                    case 1: name      = lua_tostring(L, -1);  break;
                    case 2: pri       = lua_tointeger(L, -1); break;
                    case 3: pitch_lo  = lua_tointeger(L, -1); break;
                    case 4: pitch_hi  = lua_tointeger(L, -1); break;
                    case 5: voc_num   = lua_tointeger(L, -1); break;
                    case 6: voc_dist  = lua_tointeger(L, -1); break;
                    case 7: voc_flags = lua_tointeger(L, -1); break;
                    }
                    
                    lua_pop(L, 1);
                }
                
                // do things with the values
            }
            
            lua_pop(L, 1);
        }
    }
    else
    {
        // error
    }
    
  4. In Topic: Shadow Warrior - "New Episode"

    15 June 2017 - 07:18 PM

    Your lua_gettable call is using index -1, which is the string you just pushed. If you change it to LUA_GLOBALSINDEX it should work (it's defined in one of the Lua headers, I forget which).
    Edit: It seems that in recent versions of Lua, LUA_GLOBALSINDEX has been deprecated. Which means you will have to use lua_getglobal, or do this instead:

    lua_rawgeti(L, LUA_REGISTRYINDEX, LUA_RIDX_GLOBALS); // or lua_pushglobaltable(L);
    lua_pushstring(L, "sounds");
    lua_gettable(L, -2);
    
  5. In Topic: Shadow Warrior - "New Episode"

    15 June 2017 - 07:05 PM

    lua_gettable expects a key on the stack, with the index passed to it being the index of the table to grab the table from.
    lua_getglobal is already pushing the table onto the stack, so you can either omit the lua_gettable call, or do this:
    lua_pushstring(L, "sounds");
    lua_gettable(L, LUA_GLOBALSINDEX);
    


    Edit: for reference, lua_getglobal is an alias for lua_getfield(L, LUA_GLOBALSINDEX, <key>)
    Edit 2: Also,
    static int fxid = lua_tointeger(L, -1);
    should grab the value at index -2, rather than -1

Friends

Comments

Page 1 of 1
  1. Photo 23 Feb 2014 - 15:38
    http://i.imgur.com/XNXoX6g.jpg
Page 1 of 1

All copyrights and trademarks are property of their respective owners and all comments are owned by their posters. Yes, our forum uses cookies. © 2004-2017 Duke4.net and Voidpoint, LLC

Enter your sign in name and password


Sign in options