[Question] Consistency Whitelist?

GrevasGrevas Join Date: 2014-09-16 Member: 198561Members
edited January 2015 in Modding
Hi, i have been looking around and toying with lua for a a few hours.

Haven't found the internal Whitelist for Consistency Checks, is this info public somewhere / readable in the files?
Or is there a call that would give you the list?

I've tried to extract it by Reflection but it's not enabled in the environment for some "odd" *rolleyes* reason :D
Might also have missed something, if someone cares to see the attempt:
local function dump(stuff)

¸¸¸¸if type(stuff) == "metatable" then
¸¸¸¸¸¸¸¸Shared.Message("stuff is meta")
¸¸¸¸¸¸¸¸stuff = getmetatable(stuff)
¸¸¸¸end
¸¸¸¸if type(stuff) == "table" then
¸¸¸¸¸¸¸¸for k, v in ipairs(stuff) do
¸¸¸¸¸¸¸¸¸¸¸¸if k == nil then
¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸-- weird
¸¸¸¸¸¸¸¸¸¸¸¸elseif v == nil then
¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸Shared.Message(tostring(k) .. " is nil")
¸¸¸¸¸¸¸¸¸¸¸¸elseif type(v) == "table" then
¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸Shared.Message("table=" .. k)
¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸dump(v)
¸¸¸¸¸¸¸¸¸¸¸¸else
¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸¸Shared.Message(tostring(k) .. " " .. type(v) .. "=" .. tostring(v))
¸¸¸¸¸¸¸¸¸¸¸¸end
¸¸¸¸¸¸¸¸end
¸¸¸¸else
¸¸¸¸¸¸¸¸Shared.Message("type:" .. type(stuff) .. tostring(stuff))
¸¸¸¸end
end
--dump(config)
--dump(Server)
dump(Shared)

Comments

  • DC_DarklingDC_Darkling Join Date: 2003-07-10 Member: 18068Members, Constellation, Squad Five Blue, Squad Five Silver
    wut? wha? I do not understand the question.

    If you mean the default config, thats can be looked up easy. Its in the standard server install.
  • GrevasGrevas Join Date: 2014-09-16 Member: 198561Members
    edited January 2015
    @DC_Darkling not in the default client though, right? Or I'd feel silly. Have been looking for that file..
    [edit] might be packaged into the client, could've thought about that & checked the server anyways. Atleast now i know that doing a Debugger-Window might not be possible with lua itself - worth it.
    [edit2] almost forgot... Thanks for the info!
  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited January 2015
    What you are looking for is http://ns2docs.bplaced.net/ns2docs/src/natural+selection+2/core/lua/ConsistencyConfig.lua/index.html ;) And a pure lua debugger is well possible with the right IDE but not super helpful as ns2 is running a pretty special luajit setup.

    So in the end best is to use hotloading to test changes directly in-game.

  • GrevasGrevas Join Date: 2014-09-16 Member: 198561Members
    edited January 2015
    @GhoulofGSG9‌ thanks! Have been looking for the json file and done text-search only in ns2/ folder... After a short look into the file, that's what i was afraid of, all included script files are off-limits. You might add stuff, but not change anything (i have read the Mod-Framework thread, if i can find a anonymous function in the code i'll 1. laugh and 2. be surprised).

    I'll keep digging then what's doable, need more reading first how scripts are loaded and so on :) (for pure client side stuff, since i need some side-project to really have a target while looking through the codebase)

    Still setting a dev-environment for myself up. Need to figure out how to change the IDE-plugin i'm using to understand // comment style... (IntelliJ IDEA, in case someone uses it & has got it working properly)

    [edit] after a second thought, i guess the system works in both ways. Mod-Scripts might be sent to another VM though, ... i'm babbling sorry, need my 4h sleep now :D
  • DC_DarklingDC_Darkling Join Date: 2003-07-10 Member: 18068Members, Constellation, Squad Five Blue, Squad Five Silver
    you can mod and edit whatever file you want.
    Consistency checks the servers file with the clients. So if the server runs the same mod, all is well.

    If you want to change it only locally it is still not a problem as long as you do not connect to a server.
  • GrevasGrevas Join Date: 2014-09-16 Member: 198561Members
    edited January 2015
    @DC_Darkling‌ yeah, i realize that :) i also realize this means there are no scripts open for modding on the client-side only. It's reasonable (beeing a competitive game) but also very restrictive.
  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited January 2015
    Grevas wrote: »
    @DC_Darkling‌ yeah, i realize that :) i also realize this means there are no scripts open for modding on the client-side only. It's reasonable (beeing a competitive game) but also very restrictive.

    Not completely true. You can still mod the main menu just fine (while client is not connected) :p
  • DC_DarklingDC_Darkling Join Date: 2003-07-10 Member: 18068Members, Constellation, Squad Five Blue, Squad Five Silver
    Shhh.. you are making it complicated.. But yeh. :D
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue
    edited January 2015
    Grevas wrote: »
    @DC_Darkling‌ yeah, i realize that :) i also realize this means there are no scripts open for modding on the client-side only. It's reasonable (beeing a competitive game) but also very restrictive.

    Here is a client-side code tribute to say goodbye to client-side modding when they removed it from the game in Beta. @Dghelneshi‌ wrote this and we did the video in the final client-side build.

Sign In or Register to comment.