Page MenuHomeFeedback Tracker

Additional cfgFunctions attributes (eventscript calls to function calls)
Assigned, WishlistPublic

Description

The cfgFunctions-feature has become incredible useful and preinit- and postinit-attributes makes this even more powerful.

By adding more such attributes cfgFunctions can become even more powerful:
EventScripts added in A3 (initPlayerLocal.sqf, initServer.sqf and initPlayerServer.sqf) are extremly useful for all kind of MP scripting but unfortunatly different scripts from different authors using this eventscripts can't be mixed without the hassle of merging file by file. By adding this callbacks as attribute to cfgFunctions will eliminate this problem and enable mission, script and addon authors to fully utilize the power of functions that are called upon JIP/server initlization/etc by the engine itself.

We (Terox, me and some other guys from the scripting skypegroup) thought of the following attributes (most of this calls are already in the engine as event scripts):
initServer Called if the server is initialized
initHCLocal
Called local on a HC if initialized
initHCServer Called on serverside if a HC is initialized (with HC netID as parameter)
initPlayer
Triggered on client and server if a playerobject is ready (thanks Killzone_Kid)
initPlayerLocal Called local on a client of the playerobject is ready
initPlayerServer
Called on server if a playerobject is initialized (params with playerobject and if JIP)
playerDisconnect Executed on all remaining clients and server if a player disconnects (Param: Old playerobject,Playername)
playerDisconnectServer
Executed on server if player disconnects

Details

Legacy ID
2812080976
Severity
None
Resolution
Open
Reproducibility
N/A
Category
Scripting
Steps To Reproduce

Make two missions with different features and use an eventscript (init.sqf, initPlayerServer.sqf,...) -> try to merge the missions into one.

Make a mission with a solid MP-framework (including HC).

Additional Information

A small proposal for usage of such features:
http://pastebin.com/MNKcj7Nd

Event Timeline

NeoArmageddon edited Additional Information. (Show Details)
NeoArmageddon set Category to Scripting.
NeoArmageddon set Reproducibility to N/A.
NeoArmageddon set Severity to None.
NeoArmageddon set Resolution to Open.
NeoArmageddon set Legacy ID to 2812080976.May 7 2016, 5:53 PM
NeoArmageddon edited a custom field.
Terox added a subscriber: Terox.May 7 2016, 5:53 PM
Terox added a comment.Feb 3 2014, 8:03 PM

This could be expanded to any event handler or event script.

For those who have not used cfgfunctions yet, it is the best way to initialise your code

Maybe consider initPlayer.sqf that triggers everywhere on player join?

commy2 added a subscriber: commy2.May 7 2016, 5:53 PM

initServer and initHCLocal can be done with a simple postInit already. Just check for "isServer" (initServer) or "!hasInterface && !isServer" (HC).

playerDisconnect and playerDisconnectServer could be done with postInit too by adding a HandleDisconnect mission eventhandler.
https://community.bistudio.com/wiki/addMissionEventHandler

Edit: derp. Just noticed the date. Those are possibilies now though.