Results 1 to 3 of 3

Thread: Bunch of suggestions by SDS, pack #1

  1. #1

    Bunch of suggestions by SDS, pack #1

    Hi everyone, especially devs! : )

    Well, since it is suggestion thread, I'm gonna post things that I wanted the most for, maybe, a lot of patches.

    But before I start, I want to say why I'm wanting all those functions.
    I have non-standart format of my TTS server - instead of games, it shows a whole list of them! Users able to connect, read this list, ask me to search for description, filter those, etc., etc.
    So I want to make it as easy as possible for me, and as enjoyable as possible for others!

    ------------------------------------------------------------------------------------------------------------------------

    ['Partial' Implementation] 1) I want to track, who enters and leaves my server, to create truthful statistic! So I want:
    Code:
    New Event: onConnect(Player player_info{steam_name, steam_id})
    New Event: onDisconnect(Player player_info{steam_name, steam_id})
    Possible usage: Counters, trackers, autos.
    Code:
    function onConnect(PLR)
    counter = getObjFromGUID('123541')
    counter.value = counter.value + 1
    printToAll('Server: Hello, ' .. PLR.steam_name .. '!')
    end
    [Full Implementation] 2) I really want to change way, how Player works, and make possible to select not only colored, but uncolored players too!
    Code:
    New function: getPlayer(player_id) : return Player
    New function: getAllPlayers() : return {} of id / Player
    
    [Not Implemented] Possible: Expanded class: Player
    Most of variables are the same as existing. But the changes:
    * steam_time : Stores local time for player.
    * steam_country : Stores country of player
    * steam_playtime : Stores amount of hours played in TTS
    * steam_achievements : Stores a table of achievements (true - got it, false - didnt)
    * turn_step : Stores a turn step, just like lift_height.
    * muted : Stores a 'muted' setting, just like 'blindfolded'
    * setPointerPosition : self-explainatory
    * setPointerRotation : self-explainatory
    * ban : welp. if 'kick' exists, why not 'ban' some 'unique' guys? Also, could have 0 or 1 parameter - is steam_id. In case you 'just missed' that sh*teater, and he left before you banned him.
    Usage? Various comparsions, and neat stuff.
    Code:
    function onConnect(plr)
    if (plr.steam_country == 'Japan') then
    printToAll('Konichiwaa, ' .. plr.steam_name)
    elseif (plr.steam_country == 'Germany') then
    printToAll('Guten morgen, ' .. plr.steam_name)
    else
    printToAll('Hello, ' .. plr.steam_name)
    end
    end
    [Not Implemented] 3) Some games I host support up to 22 persons. I know it is hard to even get 5 in same place, but they DO support 22. So...
    Code:
    Change: Unlimited amount of possible players.
    VVV Reworked Colors VVV
    New Function: getAllColors() : Returns {} of Number / COLOR, where COLOR is: {id, name, {red, green, blue, alpha}}
    New Function: getColor(id) : Returns {} of {name, {red, green, blue, alpha}}
    Player.changeColor now takes COLOR.id, instead of String. ID, Name (winch is visible to everyone) and color is setted either in F4 tool, in JSON file, or even through script.
    New Function: createColor(id, name, {visible_color}) : Returns GUID of newly created Hand. If not, then use another new function setPositionOfColor(ID, {position}, {rotation}, {scale})
    by the way, ID is not only numeric, but could be 'Red' as usual.
    Player[ColorID] is the same.
    New Function: deleteColor(id)
    
    Colors 'black' and 'grey' are impossible to delete.
    So, something like that. Also, hand shouldn't be mandatory, as I guess - some games doesn't require it so much. (mostly, cooperative or party games)
    Usage:
    Code:
    function onLoad()
    -- there we ask player if game will be on 2, 3, 4 or 5 players? (since that would affect how many cards are dropped)
    self.createButton(blabla, 'create2')
    self.createButton(blabla, 'create3')
    self.createButton(blabla, 'create4')
    self.createButton(blabla, 'create5')
    end
    
    function create2()
    createColor('Red', 'Red Player', {1,0,0})
    createColor('Blue', 'Blue Player', {0,0,1})
    setPositionOfColor('Red', {20, 3, 0}, {0, 180, 0}, {9,5,3})
    setPositionOfColor('Blue', {-20, 3, 0}, {0, 0, 0}, {9,5,3})
    -- there we spawn 2 sets of cards, ZZZ of 'special tokens', a board for 2 players, etc.
    end
    [Not Implemented] 4) My Lobby wants to get most fresh, actual information on games I want to play now. And how I could do that without changing JSON file every second? Answer is easy - website!
    Code:
    New Function: sendQuery_GET(String website_URI) : Returns Integer with Code, String with answer.
    New Function: sendQuery_POST(String website_URI, Table parameters) : Returns Integer with Code, String with answer.
    Usage: A crap ton of functionality between databases.
    Code:
    function parse(string)
    -- there we do things to strap header.
    end
    
    function onLoad()
    code, answer = sendQuery_GET('http://my_website.com/listofgames')
    if code == 200 then
    listOfGames = parse(answer)
    obj = spawnObject({type = 'Notecard'})
    obj.setDescription(listOfGames)
    else
    print("Error: Website is probably down. Reload me, please.")
    self.createButton({blabla, 'reload'})
    end
    end
    [Full Implementation] 5) I want my users to actually have some control over my Lobby when I am AFK. But since they don't have visible pointers, they must use only one thing left... Chat. So why not allow...
    Code:
    New Event: onChat(Player Player_Info, String Sent_message)
    This gives a TON of functionality! /votekick, /voteban, /votemute, /spawn, /rollrandom... possibilities are quite unlimited.
    Code:
    function startsWith(source, what)
    -- stuff that strips and checks
    end
    
    voteTable = {}
    function onChat(plr, msg)
    if startsWith(msg, "/vote") then
    voteTable[plr.steam_name] = msg:sub(6, -1)
    elseif startsWith(msg, "/help") then
    plr.attachCameraToObject({object = getObjectFromGUID('123123')}) -- this is help notecard
    end
    end
    [Not Implemented] 6) And, I want to also have another function... Kinda for logging purposes.
    Code:
    New function SaveToChest(String Relative_Path)
    Usage: well, hard to tell, but mostly for DND stuff, or save Chess positions to further analysis.
    Code:
    function onDisconnect(plr)
    if plr.host then
    SaveToChest('/savedsessions/D-' .. os.date("%d-$m %H:%M:%S", os.time()))
    end
    Can't remember much... But those together could make impressive thing, and change my Lobby to a whole new level!
    Last edited by Infernius; 09-07-2017 at 04:18 AM.

  2. #2
    Okay. Update 9.4.

    1) onConnect and onDisconnect are KINDA implementable through getSpectators() + tables + timer.
    Would love to have actual events, through, but this code works...
    Code:
    function checkConnectivity()
    	local allPlayersOnline = getAllPlayers()
    	
    	-- Part 1: onConnect
    
    	for i=1, #allPlayersOnline do
    		local ID, NICKNAME = allPlayersOnline[i].steam_id, allPlayersOnline[i].steam_name
    		if (currentlyConnectedPlayers[ID] == nil) then
    			currentlyConnectedPlayers[ID] = NICKNAME
    			fireEvent_OnConnect(ID, NICKNAME)
    		end
    	end
    	
    	-- Part 2: onDisconnect
    	
    	local disconnectedPlayers = {}
    	for ID, NAME in pairs(currentlyConnectedPlayers) do
    		disconnectedPlayers[ID] = NAME
    	end
    	
    	for i=1, #allPlayersOnline do
    		local ID = allPlayersOnline[i].steam_id
    		disconnectedPlayers[ID] = nil
    	end
    
    	for ID, NAME in pairs(disconnectedPlayers) do
    		currentlyConnectedPlayers[ID] = nil
    		fireEvent_OnDisconnect(ID, NAME)
    	end
    end
    
    local uniqueTimerID = "12312314asda" .. math.random(100000000)
    function onLoad()
    	Timer.create({identifier = uniqueTimerID, function_name = "checkConnectivity", delay = 1, repetitions = 0})
    end
    
    function onDestroy()
    	Timer.destroy(uniqueTimerID)
    end
    
    
    function fireEvent_OnConnect(SteamID, SteamName)
    	
    end
    function fireEvent_OnDisconnect(SteamID, SteamName)
    	
    end
    2) Well, now we able to getAllPlayers(), more or less.
    Code:
    local function getAllPlayers()
    	local pOne = getSeatedPlayers()
    	local result = Player.getSpectators()
    	for i,v in pairs(pOne) do
    		result[1 + #result] = Player[v]
    	end
    	return result
    end
    also could add black player if needed.

    AND THAT IS ALL. HEY, I REALLY WANT CHAT CONTROL, GUYS!

    *** Also, I want to set object.preserve from LUA.

  3. #3
    OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YES OH YESSSSSSSSSSSSSSSSSSSSSS!!!!!

    OnChat!
    On-Goddamn-Chat!

    Finally something to work with!!!!
    HAIL DEVS!

Similar Threads

  1. [COMMUNITY] Tumba's Warfighter Booster Pack
    By Tumba in forum Warfighter
    Replies: 0
    Last Post: 03-03-2017, 05:16 PM
  2. [READ FIRST] Suggestions Information
    By Kimiko in forum Suggestions
    Replies: 0
    Last Post: 02-06-2017, 12:35 PM
  3. [SOLVED] Expansions # 2-4 & Promo Pack?
    By vicco1 in forum Darkest Night
    Replies: 6
    Last Post: 12-02-2016, 03:31 PM
  4. Observations and suggestions
    By lorddamax in forum General Discussion
    Replies: 0
    Last Post: 03-23-2015, 09:34 PM
  5. Settlers of Catan: Model Pack
    By QQuixotic in forum General Discussion
    Replies: 5
    Last Post: 04-18-2014, 10:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •