Jump to content

6 files

  1. This is a collection of utility functions I have wrote and or accumulated over the past year or so.. 
    A great collection to get you started!
    How to use:
    ** Place the LUA file into the Source directory of your project.

    ** At the top of your main.lua entry file add this line of code:
    ** require("UltraUtilities") ** Then, any where in your code or components code - you can call any of the functions.
    ** Example usage:
    ** Local Sun = GetSunEntity() ** Sun:SetColor(255,0,255,255) Version 1.0 includes:
    function GetSunEntity()                                  -- Get the directional light ( sun ) from the map file
    function GetTerrainEntity()                             -- get the terrain handle from the map file
    function RandomFloat(lower, greater)            -- pseudo random float
    function CubicInterpolate(x0, x1, x2, x3, mu) -- cubic interpolation
    function Mysplit(inputstr, sep)                       -- split a string into chunks based off a separator - returns a table with the chunks in it
    function Note(str)                                           -- easier Notify() command, takes numbers and strings and is shorter to type
    function HasTag(ent, tag)                               -- checks if a tag is available for an actor
    function HasPartialTag(ent, ptag)                   --  returns everything AFTER ':' part of the tag
    function YnFileExists(filename)                       -- check if a file exists
    function IsMouseOverPosition(x1, x2, y1, y2) -- mouse over a position -- good for gui's
    function MyRandom(min, max, float)              -- Generate a random number with options ( float of int) 
    function Secure_Seed()                                    -- uses hardware ID's to generate a TRUELY random number in lua
    function CopyToClipboard(text)                      -- copy a string to the clipboard
    function LerpToZero(value, factor)                  -- slowly move a number to zero
    function DampToZero(value, smoothing, delta)  -- slowly move a number to zero based off millisecs()
    Stary tuned more to come !
    13
  2. Console Pad is runtime module that allows you to send messages to the screen from anywhere within your code.  I created this module for debugging variables while in runtime but over the years I have enhanced it to handle almost any text task you may need. NPC conversation, game system information and general text.  You can even talk back to it! Enter commands and configure your own /commands. 
    Usage:  
    log("This is a message") log("Variable cat = "..self.cat, red, green, blue) log("Map loaded: "..mapname, r, g, b, a, addtime ) I include this module into every project I work on and have grown dependent upon it for long term game development. 
    You can find install and usage information on my support site. 
    https://alienheaddevelopment.zya.me/viewtopic.php?t=6
     
    10
  3. By Josh, 
    This uses the Quake light animation presets to add some interesting color modulation to any entity.
    The following presets are available:
    Normal Flicker Slow Strong Pulse Candle 1 Fast Strobe Gentle Pulse 1 Flicker 2 Candle 2 Candle 3 Slow Strobe Flourescent Flicker Slow Pulse Todo:
    The candle presents don't look right to me, but I'm not sure what they are supposed to look like. I remember them as being a gentle flicker. There is no interpolation between the nearest two values, it just grabs one single value, so it's not very smooth. I guess this is appropriate for the strobe effects, but not for others.  
    1
  4. Component to move an entity to WayPoints:
    Move Speed - how much velocity entity will have while moving doDeleteAfterMovement - auto remove entity when it's reach final waypoint. Can be used for door, that goes into walls or floor Input "DoMove" - make entity move to next point Output "EndMove" - happens when entity stops after reaching final way point or if this way poiont has enabled doStayOnPoint 
    9
  5. Component-controller for top down camera Apply this component to Camera entity WASD and mouse near window border moves camera horizontally QE - to rotate camera Mouse scroll to lower/raise Put it in Components\Player folder
    5
  6. Simple component which can be used to naviage bots or objects
    nextPoint - null if it's a final onem otherwise add another entity with this component to make a chain doStayOnPoint - can be checked by object that uses WayPoints to find out if it should stay after reaching this point and wait a command before moving to next one Put in Components\Logic folder
    11

×
×
  • Create New...