Leigham Posted February 16, 2015 Report Share Posted February 16, 2015 im trying to make an addon pbo, not giving out any hints what for yet, but i have created a function in a config.cpp class CfgFunctions { class UD { class main { file = "UD"; class Init { //preInit = 1; postInit = 1; }; }; class UD_scripts { file = "UD\scripts"; class function {}; }; }; }; my fn_init /* Update 16.02.2015 By Leigham */ //Server side addon init.sqf //Options For Admins UD_Debug = True; //Compiling the Function to use in mission.pbo if (isServer) then { UD_fnc_function = compile preprocessFileLineNumbers "\q\addons\UD\scripts\fn_DeployVic.sqf"; }; diag_log "UD INIT: Text Here"; //More to Come not going to show the file, would give to much away, but is file is fn_function.sqf and its directory is @epochhive\addons\UD\scripts (UD being the pbo) and im trying to call it from the mission.pbo, i thought as a function i could call it from the mission pbo, if not how could i do this ? anyhelp would be greatly appreciated and worth a beer, thanks : D Link to comment Share on other sites More sharing options...
Leigham Posted February 16, 2015 Author Report Share Posted February 16, 2015 forgot to say that its loading 19:05:51 D:\TCAFiles\Users\LeighamM\242\@EpochHive\addons\ud.pbo - unknown but its giving me this 19:20:44 Warning Message: Script scripts\fn_function.sqf not found even though its in the scripts folder Link to comment Share on other sites More sharing options...
Darth_Rogue Posted February 16, 2015 Report Share Posted February 16, 2015 Issues with PBOs not loading files are almost always pathing errors in the prefix files. Double and triple check them. Open the PBO in PBOManager and click the gear looking icon at the top of the window. Look for the prefix field. If it's not present, add it with the appropriate path, even if PBOPrefix is present. Usually fixes it for me. Link to comment Share on other sites More sharing options...
Leigham Posted February 16, 2015 Author Report Share Posted February 16, 2015 http://gyazo.com/a4414573b57232db1c28fa573b7927fb Link to comment Share on other sites More sharing options...
Leigham Posted February 16, 2015 Author Report Share Posted February 16, 2015 http://gyazo.com/e1daf3469f38d2cbf281a5791e1076bc http://gyazo.com/1ca4c79757d2fd4be9bb77074f2a7eb3 http://gyazo.com/f90177abc0fe4346c067e2c0572e6411 cant seem to get this working, if anyone thinks they can let me know and i will pm you the files Link to comment Share on other sites More sharing options...
Leigham Posted February 16, 2015 Author Report Share Posted February 16, 2015 https://www.dropbox.com/s/uqdugq0288ezksr/epoch.Chernarus.pbo?dl=0 https://www.dropbox.com/s/byx4vhm9zkgc72i/ud.pbo?dl=0 Mission.pbo, with the Script that calls the function, scroll wheel menu and drag the UD folder into @epochhive\addons if anyone could take a look would be defianalty worth a beer, ive tried many different filenames/paths, but the fn_init cant find the file Link to comment Share on other sites More sharing options...
raymix Posted February 17, 2015 Report Share Posted February 17, 2015 You don't need both prefix files/properties, one is enough, delete pboprefix file. You can edit values yourself or have a file inside your folder that PBO packers will pick up and create property automatically for you, but as I said - one is enough. And no matter what, you need to keep folder structure in your scripts same as you instructed it within prefix value, judging by your screenshots it should look like this: UD_fnc_function = compile preprocessFileLineNumbers "\UD\fn_DeployVic.sqf"; however one of your screenshots has this: UD_fnc_function = compile preprocessFileLineNumbers "fn_DeployVic.sqf"; This is pointing to MPMissions pbo file (file that all clients downloads). If you keep it there, then this path will be valid, but since you want to use your own PBO, you must use your own paths that you define in pbo prefix. This error: 19:20:44 Warning Message: Script scripts\fn_function.sqf not found is looking for file in mission PBO under folder named "scripts" If you are confused, here's 2 examples, spot the difference: //this is scripts folder inside mission PBO scripts\fn_function.sqf //this is custom PBO with prefix value "scripts". File is in the root of folder. \scripts\fn_function.sqf Hope this helps. Link to comment Share on other sites More sharing options...
Leigham Posted February 17, 2015 Author Report Share Posted February 17, 2015 so if i use the prefix x/addons/ud i would need to call or exec /x/addons/ud/filename.sqf Link to comment Share on other sites More sharing options...
raymix Posted February 17, 2015 Report Share Posted February 17, 2015 Precisely, but with a back-slash, not a forward-slash. And the file in that case would be placed in the root of pbo. Also you don't have to use x\addons part if you don't want to. That's just a gimmick to keep things tidy between devs/mods. Link to comment Share on other sites More sharing options...
Leigham Posted February 17, 2015 Author Report Share Posted February 17, 2015 ok im testing that method now, ill let you know how it works out Link to comment Share on other sites More sharing options...
Leigham Posted February 17, 2015 Author Report Share Posted February 17, 2015 Could not load '\ud\scripts'. Extension not listed in allowedPreprocessFileExtensions im getting this now ? any ideas ? Link to comment Share on other sites More sharing options...
raymix Posted February 17, 2015 Report Share Posted February 17, 2015 Let me give you another interesting example how BI split their huge files into smaller PBOs while keeping same structure and compatibility: Let's say you want to create huge world with ton of custom objects and textures. When you pack it, it would end up around 5GB. This is very realistic scenario, tbh. When game loads, only headers and configs of PBO are read, that's it. When you load terrain data, whole PBO is loaded from HDD into RAM and then required files are copied over, PBO is then unloaded. If you have basic technical background, you should know that this is bad news on 32-bit OS, not to mention the time required to load the whole damn thing every time you drive few hundred meters with your car, forget flying. Lets say, we have our terrain data, models, rvmats and textures in seperate folders. What can be done is - you simply pack each folder seperately and adjust PBO prefixes to match original folder structure. Example: // Windows folder structure before PBO packing \myAwesomemod\terrain.wrp \myAwesomemod\models\*.p3d \myAwesomemod\data\*.paa \myAwesomemod\mats\*.rvmat //Instead of packing it all into one PBO, we create 4 smaller PBOs while maintaining perfect compatibility // PBO prefix for WRP file myAwesomemod // PBO prefix for models myAwesomemod\models // PBO prefix for textures myAwesomemod\data // PBO prefix for materials myAwesomemod\mats This way if only model needs to be loaded or texture for specific terrain grid, only smaller PBO will be loaded instead of a whole. You can ofcourse keep splitting it into even smaller chunks, sky's the limit. Link to comment Share on other sites More sharing options...
raymix Posted February 17, 2015 Report Share Posted February 17, 2015 Could not load '\ud\scripts'. Extension not listed in allowedPreprocessFileExtensions im getting this now ? any ideas ? https://community.bistudio.com/wiki/server.cfg#Server_Security you'll need to whitelist sqf, but pretty sure that will weaken your server's defenses if it was blacklisted by epoch devs. Link to comment Share on other sites More sharing options...
Leigham Posted February 17, 2015 Author Report Share Posted February 17, 2015 allowedPreprocessFileExtensions[] = {"sqf"}; sqf is already whitelisted ? Link to comment Share on other sites More sharing options...
raymix Posted February 17, 2015 Report Share Posted February 17, 2015 I'm afraid I got not answer to that one. This is a different problem and would probably make more sense to make a new topic for it, since your files are now found and loaded. It could be somehow related to this issue posted by one of dayz/epoch devs, not sure tho. I am only guessing this because I've been told that A3E does not use init.sqf from mission pbo due to hacking issues. So obviously there's something else going on in the background, no idea what it is, don't have epoch server or files. Best of luck on the issue, tho. Link to comment Share on other sites More sharing options...
Leigham Posted February 17, 2015 Author Report Share Posted February 17, 2015 would it work if i used an ExecVM \ud\deployvic.sqf"; from the file in my mission.pbo instead of compiling at as a function Link to comment Share on other sites More sharing options...
raymix Posted February 17, 2015 Report Share Posted February 17, 2015 ExecVM simply loads from hard drive, while precompiling loads it into RAM. It's the same thing essentially. Location of your file does not matter, you will get the same error. Link to comment Share on other sites More sharing options...
Leigham Posted February 17, 2015 Author Report Share Posted February 17, 2015 How would i go about executing a server file from client EI spawning a vehicle on the server, but from a client side script Link to comment Share on other sites More sharing options...
KiloSwiss Posted February 17, 2015 Report Share Posted February 17, 2015 Client use:publicVariableServerServer use:addPublicVariableEventHandlerbtw.Have a look into this example addon to make it clear on how to auto execute scripts from an addon:http://kiloswiss.ch/misc/arma3/a3autoexec_addon.zipGreez KiloSwiss Link to comment Share on other sites More sharing options...
Leigham Posted February 17, 2015 Author Report Share Posted February 17, 2015 so how would i implement an eventhandler to execute a script ? Link to comment Share on other sites More sharing options...
KiloSwiss Posted February 17, 2015 Report Share Posted February 17, 2015 https://community.bistudio.com/wiki/publicVariableServerhttps://community.bistudio.com/wiki/addPublicVariableEventHandlerGreez KiloSwiss Link to comment Share on other sites More sharing options...
Leigham Posted February 18, 2015 Author Report Share Posted February 18, 2015 Server File if(isServer) then { "UDVIC" addPublicVariableEventHandler { private["_veh","_pos","_fuel","_damage","_direction","_searchRadius","_spawnPos"]; _veh = _this select 0; _pos = _this select 1; _pos set[2, 0]; _fuel = if(count _this > 2)then[{_this select 2},{0.15 max (random .35)}]; _damage = if(count _this > 3)then[{_this select 3},{0.35 max (random .75)}]; _direction = if(count _this > 4)then[{_this select 4},{random 360}]; _veh = createVehicle[_veh, _Pos, [], 0, "NO_COLLIDE"]; _veh allowDamage false; _veh setDir _direction; _veh setVectorUp (surfaceNormal (getPos _veh)); _veh call EPOCH_server_setVToken; _veh call EPOCH_server_vehicleInit; _veh setVariable ["UD_vehicle", true]; _veh disableTIEquipment true; _veh lock 2; _veh setFuel _fuel; _veh setDamage _damage; _veh allowDamage true; _veh }; private["_veh","_pos","_fuel","_damage","_direction","_searchRadius","_spawnPos"]; }; and Client UDVIC = [ cutText [format["Checking if you have Salvage Metal for the Ebike"], "PLAIN DOWN"]; sleep 3; if ("ItemCorrugated" in magazines player) then{ player playActionNow "Medic"; sleep 3; _spawn = "ebike_epoch"; _posplr = [((getPos player) select 0) + 2, ((getPos player) select 1) + 2, 0]; _dirplr = getDir player; _spawnveh = [_spawn,_posplr,1,0,_dirplr] execvm"\ud\fn_deployvic.sqf"; _spwnveh setVariable ["Sarge",1,true]; sleep 3; cutText [format["You've used your Corrugated to build a Ebike."], "PLAIN DOWN"]; } else { SystemChat "You need one Corrugated to build an Ebike"; }; ]; publicVariableserver "UDVIC"; Something like that ? Link to comment Share on other sites More sharing options...
KiloSwiss Posted February 18, 2015 Report Share Posted February 18, 2015 Not sure if it works to check the players magazines serverside and keep in mind, this code is not testet! /* client script */ titleText ["Checking if you have Salvage Metal for the Ebike", "PLAIN DOWN"]; sleep 3; if("ItemCorrugated" in (magazines player))then[{ titleText ["", "PLAIN DOWN"]; player playActionNow "Medic"; _spawnPos = player modelToWorld [0,2,0]; _spawnPos set[2,(0 max (getPosATL player) select 2)]; _spawnDir = (getDir player) -90; UDVIC = [player, _spawnPos, _spawnDir]; sleep 3; publicVariableServer "UDVIC"; sleep 1; titleText ["You've used your Corrugated to build a Ebike.", "PLAIN DOWN"]; },{ titleText ["You need one Corrugated to build an Ebike", "PLAIN DOWN"]; }]; /* Server script */ if(isServer) then { "UDVIC" addPublicVariableEventHandler {_this select 1 call Spawn_Ebike}; Spawn_Ebike = { private["_playerObj","_spawnPos","_spawnDir","_veh","_goat"]; _playerObj = _this select 0; _spawnPos = _this select 1; _spawnDir = _this select 2; if("ItemCorrugated" in (magazines _playerObj))then[{ _veh = createVehicle["Ebike_Epoch", _spawnPos, [], 0, "NO_COLLIDE"]; _veh allowDamage false; _veh setPos _spawnPos; _veh setDir _spawnDir; _veh setVectorUp (surfaceNormal (getPos _veh)); _veh call EPOCH_server_setVToken; _veh call EPOCH_server_vehicleInit; _veh setVelocity [0,0,.1]; _veh allowDamage true; },{ _goat = createAgent ["Goat_random_F", _spawnPos, [], 0, "FORM"]; _goat setVariable ["BIS_fnc_animalBehaviour_disable", true]; [_goat,_playerObj] spawn { private ["_goat","_playerObj","_end"]; _goat = _this select 0; _playerObj = _this select 1; _end = time + 300; waitUntil{ UIsleep 10; _goat moveTo (getPos _playerObj); (!alive _goat || time >= _end) }; _goat setDamage 1; sleep 30; hideBody _goat; }; }]; }; };If it spawns a goat, we're all doomed!Greez KiloSwiss Link to comment Share on other sites More sharing options...
Leigham Posted February 18, 2015 Author Report Share Posted February 18, 2015 im Guessing Spawn_ebike is the file name ? Link to comment Share on other sites More sharing options...
Leigham Posted February 19, 2015 Author Report Share Posted February 19, 2015 TYVM KILO :D Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now