Page 1 of 4 123 ... LastLast
Results 1 to 10 of 38

Thread: A few mods ill release , My eventhandler, mine mod and Weapons limiter

  1. #1
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,269

    Post Purple Mods

    Hi

    Just thought ill release a few mods ive made and use on my server

    1. Eventhandler - Handy script that handles the reborn events and makes it easy for people to add script to , with a nice feedback options && Auto Load Feature
    2. Mine mod -Includes Proxy Mine, Stickybombs with adjustable timers , and C4 !!!!!!
    3. Weapon & Ammo Limiter - My weapon limiter - Completely CVAR controlled , including Ammo !!!! :P
    - NOW with on demand Swap weapon feature
    - CKR Realism Support Built In, no need to have it separate, just enable is via set ckr_realism "1"

    please note: this is not a forced weapon swap, it gives the player the choice to swap or not, but the admin can decide what weapons are allowed to be swapped through an array

    Mods
    1. PurpleEventhandler v 1.02 .rar v1.02 16/11/14
    2. PurpleMine Mod.rar
    3. PurpleWeapon Mod v 1.02 .rar v1.02 19/11/14


    Note: The Weapon mod and Mine mod are set up to load into my eventhandler auto once you exec the script from dmprecache.scr, if the eventhandler isnt running , it registers the event for you but its highly recommended to use my Eventhandler


    Event Readme.txt
    Code:
    ////////////////////////////////////////////////////////////////////
    //////////// Purple EventHandler //////////////////////////////////
    ///////////////////////////////////////////////////////////////////
    Purple Elephants Eventhandler
    
    Purple Elephants Eventhandler 1.02
    
    Very helpful script to help organise the Reborn events 
    
    
    -------- Changelog 16/11/2014 -----
    v1.02
    
    *Added Auto_Load feature
    - will automatically load scripts within the selected event folders
    under global/events/<eventname>/
    
    *fixed bug when thread not included ie main thread
    
    
    -------- Changelog 25/09/2013 -----
    v1.01
    
    --Added the following fixes--
    * Bugged scores when starting map
    * Freezetag spectators being affected by spawn event
    * Freezetag first round, spawn event not triggered for already spawned players
    * Elgbot Support
    
    * Adds state tags to player for spawn, disconnect and connected
    - local.player.spawned
    - local.player.connected
    Then removes it after a set time , level.tagwait , advised not to go higher then 10. 
    Useful if you want to just check if a player spawned without registering an event.
    
    ------------------------------------
    Usage : 
    First Add the following to your dmprecache.scr
    -------------------------------
    exec global/eventhandler.scr
    -------------------------------
    Also Fixed the problem that spawn events are triggered at map change and/or restarts , so no need to add it twice.
    
    NOTE:: You CAN use both methods below, you are not limited to one or the other.
    
    /////////////////////////////////////////////////////////
    **** Auto Load Feature
    This feature is limited to the main thread of each script, so 1 event per script, if you require thread based event scripts, please see the Advanced Registering mode
    
    TO TURN ON THIS FEATURE >> Go to the event_handler settings, and set level.auto_load to 1  
    
    With this feature, it makes loading event scripts even easier, does not require them to be registered like in the Advanced Registering mode.
    All you have to do is place the script you want to load within the given event folder.
    under global/events/<eventname>/
    and will automatically load scripts within the selected event folder
    
    
    Example:
    
    If you place a file names spawn.scr inside the global/events/spawn/  folder, it will load when the spawn event is triggered.
    So any script within the global/events/spawn/ folder will be triggered on spawn
    
    
    ///////---------------------//////// Advanced Registering /////////-----------------------------------//////
    This method is for advanced users who require the event to be triggered on a certain thread inside the script, or would rather a different directory to load the scripts from. This method lets you set the path and thread of each event manually.
    
    Add to any script in which you want the event to be registered
    
    waitexec global/eventhandler.scr::register event script
    
    Examples::
    
    waitexec global/eventhandler.scr::register spawn global/testscript.scr::main
    or
    waitexec global/eventhandler.scr::register connected global/testscript.scr::connected
    
    Your script should look like 
    global/yourscript.scr::yourlabel local.player:
    
    /////////---------------///////////////////////////////////////////-----------------------------////////////

    Weapon Mod Readme]
    Code:
    /*
    Purple Elephants Complete Weapon Limiter
    
    Version 1.02
    19 Novemeber 2014
    
    *Added CKR Realism Support
    
    Version 1.01 
    14 Novemeber 2014
    
    *Added Weapon swap
    
    Usage: 
    
    Place
    -------------------------------
    exec global/weapons.scr::main
    -------------------------------
    In global/dmprecache.scr
    
    If you are NOT using my eventhandler, you will need to place 
    -------------------------------------------
    local.result = registerev "spawn" global/weapons.scr::spawn
    local.result = registerev "keypress" global/weapons.scr::swap
    ------------------------------------------
    to your global/dmprecache.scr 
    
    ////////////////////////////////////////////////////////////////
    Cvar settings
    -------------
    Each weapon and its ammo are controlled via cvars.
    
    Example for sniper
    set pe_sniper 1_2_3
    1 = On or off   0 or 1
    2 = Clipsize   - Amount of rounds are in one clip
    3 = Starting Amount  - This is the Starting amount of ammo given BEFORE clip is loaded, clip amount is then taken from Starting amount. 
    
    Note: Grenades and Rockets DO NOT use the clipsize amount, they are limited to 1 only, so for them you would just use 1_2 
    ie
    set pe_grenade 1_2
    1 for ON
    2 for Amount of grenades
    
    Other Cvars include:
    -----------------
    
    set ckr_realism "1"          1 ON 0 OFF     - If ON, CKR Realism Settings are applied, note this removed the settings like clipsize and dmstartammo from the other cvars
    
    Both of these are triggered if the player chooses a weapon which is turned OFF 
    set pe_weapon_message "1"    1 ON 0 OFF     - If ON , player will be displayed a list of allowed weapons, if OFF , no message will be displayed
    set pe_weapon_choice "0"     1 ON 0 OFF     - If ON , a player will get to choose another weapon and respawn , if OFF , players will be forced to a Sniper as default 
    
    set pe_weapon_swap "1"        1 ON 0 OFF     - If ON , player will be allowed to swap his weapon for the other teams equilivent weapon
    set pe_weapon_swap_time  #                    - Sets the time in Seconds of how long between weapon swaps , set high if you only want them to be able to swap once
    set pe_weapon_swap_key 'key'                - Sets the keybinded key players use to swap weapons
    
    set pe_allweapons #     1 = All weapons                  - Player gets all weapons , including those of the other team
                            2 = All Team Weapons            - Player gets all weapons of their team
                            3 = All Allowed Team Weapons    - Player gets all of the Allowed weapons of their team
                            4 = All Allowed Weapons            - Player gets all of the Allowed weapons , including those of the other teams
                            
    
                            
    So you can have a variety of different weapon variations
    Say you want sniper only , you set
    pe_sniper 1_5_47
    and all others off
    OR
    If you wanted dual rifles, you would set 
    pe_rifle 1_10_60
    All others off, 
    and Also 
    pe_allweapons 4
    
    
    Example Config:
    ------------------------------
    set ckr_realism "0"
    
    set pe_weapon_message "1"
    set pe_weapon_choice "0"
    
    set pe_weapon_swap "1"
    set pe_weapon_swap_time = "10"
    set pe_weapon_swap_key = "i"
    
    set pe_shotgun "0_5_35"
    set pe_rifle "1_5_55"
    set pe_sniper "1_5_47"
    set pe_smg "1_20_140"
    set pe_mg "0_30_180"
    set pe_pistol "1_8_16"
    
    set pe_rocket "0_6"
    set pe_grenade "1_2"
    ------------------------------
    Mine Mod Readme
    Code:
    /////////////////////////////////////////////////////////////
    ////////////////// Purple Mines Mod ////////////////////////
    ////////////////////////////////////////////////////////////
    /*
    Mine Mod V1 
    16th June 2013
    
    Adds 3 types of mines to the game
    1. Proximity Mine
    2. StickyBomb
    3. C4 
    
    All in the grenade weaponslot , can be used alongside normal grenades 
    
    PRequires Reborn Patch 1.12 >>> www.x-null.net
    
    
    Place
    -------------------------------
    exec global/mines/main.scr::main
    -------------------------------
    In global/dmprecache.scr
    
    ----- Suggested to Also download my EventHandler for reborn events ----------------
    
    If you are NOT using my eventhandler, this will use the spawn event 
    -------------------------------------------
    
    Mine Usage:
    ------------
    Select Mines ( use weaponclass grenade ) or scroll weapons until you get them
    Press [Fire] to place a mine, 
    When a player steps on the mine , it will explode. Can have multiple mines out on the battlefield at one time
    
    Stickybomb Usage:
    -----------------
    Select Stickybomb ( use weaponclass grenade ) or scroll weapons until you get them
    Time Delay --- Players can choose what time they want the stickybomb to go off at
    Press [Secondary Fire] to toggle between times ( displayed bottom right ) Min = 5 seconds , Max = 30 seconds , Times goes up by 5 each time. 
    Press [Fire] to throw the Stickybomb
    Once Timer has been reached , Stickybomb will explode
    OR
    If the Stickybomb is Shot , it will explode immediately
    Note: It will remember your last timedelay setting , until you die that is
    
    C4 Usage:
    ---------
    Select C4 ( use weaponclass grenade ) or scroll weapons until you get them
    Press [Fire] to throw the C4
    Press [Secondary Fire] to Set off the C$ 
    Once Trigger has been pushed , C4 will explode
    OR
    If the C4 is Shot , it will explode immediately
    
    CVARS
    ------
    set pe_mine_mod 1        // On of Off
    set pe_mine_instructions // On or Off === Displays instructions on how to use each weapon as they select them
    
    set pe_mines 1          // On of Off
    set pe_mine_amount #      // Number of Mines available , === Max Being 8 IF you DONT have any other mines === ( or you could adjust the huds yourself if you want more with other mines ) 
    
    set pe_stickybomb 1     // On of Off
    set pe_sticky_amount #  // Number of Stickybombs available , === Max Being 8 IF you DONT have any other mines === ( or you could adjust the huds yourself if you want more with other mines )
    
    set pe_c4 1             // On or Off
    set pe_c4_amount #        // Number of C4available , === Max Being 8 IF you DONT have any other mines === ( or you could adjust the huds yourself if you want more with other mines )
    
    
    Example Config:
    ------------------------------
    set pe_mine_mod "1"
    set pe_mine_instructions "1"
    
    set pe_mines 1
    set pe_stickybomb_amount 4
    set pe_c4 0
    
    ------------------------------
    
    Conflicts
    ----------
    Uses ihuddraws indexs 100 - 131 , depending on settings above
    
    
    Credits
    --------
    Proximity Mine - Elgan & ArMaGedDoN
    StickyBomb         - Elgan
    C4                - Elgan && PurpleElephant
    
    Weapon.tiks     - PurpleElephant
    
    Mod by PurpleElephant
        
    */
    Also The Eventhandler comes with a settings.txt file , and has a nice feedback portion to help scripters, here is what the settings and feedback looks like
    Code:
    //// 1 = ON  , 0 = OFF //////////////////
    level.reg_spawn = 1
    level.reg_connected = 1
    level.reg_disconnected = 1
    level.reg_intermission = 1
    level.reg_damage = 1
    level.reg_kill = 1
    level.reg_keypress = 1
    level.reg_servercommand = 0
    
    ///Auto Load Feature
    level.auto_load = 1
    
    ///wait time
    level.tagwait = 10
    
    /// Basic Feedback Settings
    /// Displays if the events were successfully registered , already registered , Error occured or Not Event wasnt called
    level.event_feedback = 1
    
    /// ^^^ Basic Feedback has to be 1 aswell ^^^ //////
    /// Displays what scripts are currently exec from each event
    level.event_advancedfeedback = 1
    
    The Feedback looks like this in console logs
    
    Basic Feedback SHows what events have been registered and which ones didnt 
    //////////////////////////////////////////////////////////////////////
    
    ~~~~~~~~~~~~~~~~~ Event Handler FeedBack ~~~~~~~~~~~~~~~~~~~~
    
    ~~~~Successful Registered Events~~~~
    
    Spawn || Connected ||  Disconnected ||  Intermission ||  Damage ||  Kill Event || Keypress ||
    
    ~~~~Already Registered Events~~~~
    
    None
    
    ~~~~Unsuccessful Registered Events~~~~
    
    None
    
    ~~~~Events Not Called~~~~
    
     Servercommand
    
    ~~~~~~~~~~~~~~~~~ End Handler FeedBack ~~~~~~~~~~~~~~~~~~~~
    //////////////////////////////////////////////////////////////////////////////
    
    Advanced Feedback includes each script which which is exec in each event
    
    //////////////////////////////////////////////////////////////////////////////
    
    ~~~~~~~~~~~~~ Advanced Event Handler FeedBack ~~~~~~~~~~~~~~~~
    
    ~~~~Spawn Events~~~~
    
    global/weapons.scr::spawn || global/mines/main.scr::spawn || 
    
    ~~~~Connection Events~~~~
    
    None
    
    ~~~~Disconnected Events~~~~
    
    None
    
    ~~~~Intermission Events~~~~
    
    None
    
    ~~~~Damage Events~~~~
    
    None
    
    ~~~~Kill Events~~~~
    
    None
    
    ~~~~Keypress Events~~~~
    
    None
    
    ~~~~Servercommand Events~~~~
    
    None
    
    ~~~~Duplicates Errors ~~~~
    
    None
    
    ~~~~~~~~~~~~~ End Advanced FeedBack ~~~~~~~~~~~~~~~~
    
    */
    Note: Duplicate errors occur when you have added the same script twice, it will only let you add one , to avoid scripts running twice, this is very common with scripts exec from dmprecache, a good way to avoid it is to have

    Code:
    if(level.yourscript_run)
    end
    
    level.yourscript_run=1
    At the start of the mod so it only runs once per round/map

    I have tested them and it works fine for me , but they might still have a few minor problems , feel free to tell me lol
    Last edited by Purple Elephant1au; December 24th, 2014 at 10:26 PM.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  2. #2

    Default

    well done budd
    keep up the good work.

  3. #3
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,269

    Default

    Thanks :P

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  4. #4

    Default

    Excellent have added these to the Mod database great work dude many thanks

  5. #5
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,269

    Default

    Kool , HSB , although the readme are abit off on the ones you posted , the one on this page is all 3 put together, the individual readme.txt are included in each seperate mod .

    Ill be updating the weapon mod when i get a change using the new .inventory command and adding in the weapon swap feature which allows the players to choose to swap their weapon for the other teams equivalent, ie springfield for kar98sniper, bar for mp44, by a keyp or similar. Just have to start getting used to using the file handlers to create a weaponswapinfo file so they keep their choice throughout the map. Or ill use Sor's framework to store client data, ill think of something.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  6. #6
    Developer Sor's Avatar
    Join Date
    Aug 2010
    Location
    The Medieval City of Bruges
    Posts
    747

    Default

    Purple, didn't I show you how to de/serialize an array with the framework?

    Client IDs (entity numbers really) will point to the same client over rounds and maps until the client in question disconnects.
    So all you need maintain is an array with indices 0 to sv_maxclients-1 that hold whatever data you want to associate with
    the client (no entities or associative arrays though). When a client disconnects, you'd need to clear his data in the array.

    When a round or level ends, serialize the array to string and save it in a cvar.
    Code:
     string Serialize(<array> array)
     =================================================================
     OVERVIEW|: Serializes specified array as a string that can be saved
                in a cvar or in a file on disk.
     RETURN     |: <string>;
                or NIL upon failure.
                
     NOTE 1     |: Serializing entities/listeners is not supported and they 
                will be deserialized as a NULL listener.
          2     |: The array must not contain strings that consist of non-
                printable characters or the Deserialization process may 
                produce unexpected results.
          3     |: The value and order of the array elements will remain 
                unchanged but the indexing of those elements isn't saved.

    When a round or level starts you deserialize it back into the original array.
    Code:
     array[] Deserialize(<string> serializedArray, [<int> startIdx]) 
    =================================================================
     OVERVIEW|: Deserializes a previously serialized array back to an array.
                By default, the array indexing starts at 1, but you may
                specify otherwise.
     RETURN     |: <array>;
                 or NIL upon failure.
                
     NOTE 1     |: Deserialized elements will be auto-casted back to their  
                respective types. 
          2     |: The array returned and all the arrays it contains are 
                mutable arrays.
    This being a temporary measure. I've been in vacation mode the past week But I wouldn't have been able to
    release any updates without Razo's update since the new version uses the new 'fnewdir()' and 'fremovedir()' commands.

    I'm currently finishing up some things so I can start on the local and session storage as well as the client local and session storage.
    Morpheus Script (MoH) => You try to shoot yourself in the foot only to discover that MorpheusScript already shot your foot for you.

  7. #7
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,269

    Default

    Well atm the swap mod does the same thing but instead using strings.scr to compile and decompile the string containing the swap data , so not in a hurry to just change it over to the above method , specially if its a temporary one , thats why im waiting patiently for the local and session storage feature of yours :P

    More updating it to support the inventory command , since the primary weapon is always inventory[0] , seems more reliable then getactiveweap , because they can always quickly change to pistol on spawn and it misses them if they had a MG when theyre not allowed.
    It will also allow swapping mid round aswell, without them actually using the weapon they want to swap , so they could pick up a dead axis players SMG and want allie one , they can swap then aswell.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  8. #8

    Default

    Quote Originally Posted by Purple Elephant1au View Post
    Kool , HSB , although the readme are abit off on the ones you posted , the one on this page is all 3 put together, the individual readme.txt are included in each seperate mod .

    Ill be updating the weapon mod when i get a change using the new .inventory command and adding in the weapon swap feature which allows the players to choose to swap their weapon for the other teams equivalent, ie springfield for kar98sniper, bar for mp44, by a keyp or similar. Just have to start getting used to using the file handlers to create a weaponswapinfo file so they keep their choice throughout the map. Or ill use Sor's framework to store client data, ill think of something.
    Ahh yeh will update the readme now

  9. #9
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,269

    Default

    Hi

    Updated the eventhandler to fix a few known bugs

    Code:
    -------- Changelog 25/09/2013 -----
    
    --Added the following fixes--
    * Bugged scores when starting map
    * Freezetag spectators being affected by spawn event
    * Freezetag first round, spawn event not triggered for already spawned players
    * Elgbot Support
    
    * Adds state tags to player for spawn and connected
    - local.player.spawned
    - local.player.connected
    Then removes it after a set time , level.tagwait , advised not to go higher then 10. 
    Useful if you want to just check if a player spawned without registering an event.
    ---------------------------------
    Last edited by Purple Elephant1au; November 16th, 2014 at 12:34 AM.

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




  10. #10
    Purple Developer Purple Elephant1au's Avatar
    Join Date
    Feb 2012
    Location
    Australia
    Posts
    1,269

    Default

    Hi

    Updated

    Eventhandler - Now with an Auto_Load Feature, all you have to do is place the script inside the selected event folder and it will be triggered on the event

    Weapon Handler - Now with swap weapon feature - please note: this is not a forced weapon swap, it gives the player the choice to swap or not, but the admin can decide what weapons are allowed to be swapped through an array

    See 1st post for updated links and readme

    Purple's Playground
    OBJ :
    103.29.85.127:12203
    xfire: purpleelephant1au
    email: purpleelephant1au@gmail.com
    skydrive: PurpleElephantSkydrive




Posting Permissions

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