Jump to content
Sign in to follow this  
h a w a i i a n

Vehicle Respawn Module Help

Recommended Posts

I have no scripting ability or worst....little understanding of scripting. I don't want to make time to script because I'm afraid I will overwhelm myself in doing so (time consuming etc.), so I'd rather not pursue scripting for now and I hope you respect that. I would like to ask for help though, I am referring to a number of vehicle respawn threads methods that I've tried to implement myself. Okay so I have a Vehicle Respawn Module in the editor placed and I synced 4 vehicles and in the init's I have

               this setObjectTexture [0,"hmmwv_body_canvas_1_co.paa"];   
               this setObjectTexture [1,"hmmwv_hood_canvas_co.paa"];  
               this setObjectTexture [2,"hmmwv_regular_1_co.paa"]; 
               this setObjectTexture [3,"hmmwv_canvas_1_co.paa"];

that's in just one vehicles init and I have this in my my mission folder init SQF under a bunch of other stuff before that for other game functions for instance "nofatigue.sqf, etc.." And in the init I have

Fnc_Set_Textures =
   {
           if (_this iskindof "DAR_M1167") then {
               _this setObjectTexture [0,"hmmwv_body_canvas_1_co.paa"];   
               _this setObjectTexture [1,"hmmwv_hood_canvas_co.paa"];  
               _this setObjectTexture [2,"hmmwv_regular_1_co.paa"]; 
               _this setObjectTexture [3,"hmmwv_canvas_1_co.paa"];
               };
           if (_this iskindof "DAR_M115_MK19") then {
               _this setObjectTexture [0,"hmmwv_body_canvas_1_co.paa"];  
               _this setObjectTexture [1,"hmmwv_hood_canvas_co.paa"]; 
               _this setObjectTexture [2,"hmmwv_regular_1_co.paa"];  
               _this setObjectTexture [3,"hmmwv_canvas_1_co.paa"]; 
               _this setObjectTexture [4,"hmmwv_gpk_tower_co.paa"];    
               };
           if (_this iskindof "DAR_M1151") then {
               _this setObjectTexture [0,"hmmwv_body_canvas_1_co.paa"];   
               _this setObjectTexture [1,"hmmwv_hood_canvas_co.paa"];   
               _this setObjectTexture [2,"hmmwv_regular_1_co.paa"]; 
               _this setObjectTexture [3,"hmmwv_canvas_1_co.paa"];  
               _this setObjectTexture [4,"hmmwv_gpk_tower_co.paa"];
               };
           if (_this iskindof "DAR_M1165_GMV") then {
               _this setObjectTexture [0,"hmmwv_body_canvas_1_co.paa"];      
               _this setObjectTexture [1,"hmmwv_hood_canvas_co.paa"];     
               _this setObjectTexture [2,"hmmwv_regular_1_co.paa"]; 
               _this setObjectTexture [3,"hmmwv_canvas_1_co.paa"];    
               _this setObjectTexture [4,"hmmwv_gpk_tower_co.paa"];
               };
   };

In the Expression of the Vehicle Respawn Module I have

(_this select 0) spawn Fnc_Set_Textures;  

What am I doing wrong?

4Z7CbH.jpg

If this does not work can someone please help compile a vehicle script with the vehicles inits intact? That's all I need is my humvees to respawn with my retextures that I made in paa files, files that are in my mission folder. I've tried so many different things the last couple days, I jst want this done so I can move on you know? lol

Edited by Hawaii_Based

Share this post


Link to post
Share on other sites

No replies eh? It's okay, as persistent as I am (even thru Hurricane Iselle) I managed to find a workaround using a script by Iceman77 http://forums.bistudio.com/showthread.php?168216-Light-Vehicle-Respawn-Script I implemented his script to help me respawn my vehicles with my own textures that I had in my mission folder. Here's instructions if anyone wants to try this, first place a vehicle (in my case it was an LAV) go into the vehicles init and put the setobjectTexture command in there for example:

this setObjectTexture [0,"lavbody_co.paa"];   this setObjectTexture [1,"lavbody2_bunny_cust_co.paa"]; _nul = [this, 1, 1, {[_this] call TAG_FNC_LAV25A2Init}] execVM "vehRespawn.sqf"; 

_nul = [this, 1, 1, {[_this] call TAG_FNC_LAV25A2Init}] execVM "vehRespawn.sqf"; calls the command for that specific vehicles init function. When or if you download Iceman77's demo mission he will have a "vehInitFunctions" SQF that will look like this (you can obviously see where I edited/implemented my own function for my vehicle init

TAG_FNC_TankInit = {

// -- Example code. You can work with the vehicle anyway you like here!! -- //
_veh = _this select 0;
_veh disableTIEquipment true;

};

TAG_FNC_HunterInit = {

// -- Example code. You can work with the vehicle anyway you like here!! -- //
_veh = _this select 0;
_veh setFuel 0.5;

};

TAG_FNC_HunterHMGInit = {

_veh = _this select 0;
_veh setVehicleAmmo 0.1;

};

TAG_FNC_HunterGMGInit = {

_veh = _this select 0;
_veh setVehicleAmmo 0.2;

};

TAG_FNC_slammerInit = {

_veh = _this select 0;
_veh setVehicleAmmo 0.6;

};

TAG_FNC_marshallInit = {

_veh = _this select 0;
_veh setVehicleAmmo 0.8;

};

TAG_FNC_LAV25A2Init = {

_veh = _this select 0;
_veh setObjectTexture [0,"lavbody_co.paa"]; 
_veh setObjectTexture [1,"lavbody2_bunny_cust_co.paa"]
};


// -- ADD MORE FUNCTIONS HERE!! -- //



Your going to have to add

[] call compile preProcessFile "vehInitFunctions.sqf";
};

into your "init.SQF". I had to add this among other SQF stuff. At first it didn't work until I added it before other SQF commands. Alot of testing went into this, and in the end it was that fucking simple. I don't even know how to script, I just figure shit out that's what this Hawaiian does. Hopefully I haven't left anything out, If you have questions I'll be glad to help.

Share this post


Link to post
Share on other sites

Forgot to mention if you want this to show up in a LAN/online game ,you'll instead have to use "setObjectTextureGlobal" instead of "setObjectTexture".

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×