tdavison Posted February 15, 2015 Report Share Posted February 15, 2015 I have this in my script: //create helicopter and position it _heliPosition = [5541.9214,16432.719,60]; _supplyHeli = createVehicle ["I_Heli_light_03_unarmed_F", _heliPosition, [], 90, "FLY"]; //add crew to vehicle createVehicleCrew (_supplyHeli); In the game, it spawns the helicopter in the air (which is what I wanted it to do), adds the crew, but then the helicopter de-spawns and the crew falls to their deaths. Aside from being funny, does anyone know why the helicopter de-spawns within seconds of spawning? Thanks Link to comment Share on other sites More sharing options...
nedfox Posted February 15, 2015 Report Share Posted February 15, 2015 That's the AH preventing scripted createvehicle probably... Check the logs you'll see it somewhere. Put in : diag_log format["NPC HELI SPAWN"]; In your script and look for the lines in the log to find it. Link to comment Share on other sites More sharing options...
stonXer Posted February 15, 2015 Report Share Posted February 15, 2015 _supplyHeli call EPOCH_server_vehicleInit; _supplyHeli call EPOCH_server_setVToken; Link to comment Share on other sites More sharing options...
tdavison Posted February 15, 2015 Author Report Share Posted February 15, 2015 Thanks- It is working now. I have a feeling the setVToken is what allowed it to stay. Funny thing now is when the crew sees me approach, it moves away. I'll get all that handled in the script though. Thanks very much for your responses. Link to comment Share on other sites More sharing options...
stratusc Posted March 22, 2015 Report Share Posted March 22, 2015 Hi! I am relatively new to scripting and I'm trying to do nearly exactly this same thing. I have tried as many variations as I can think of, including the previously mentioned snippets from stonXer, yet I am still having issues with the helicopter disappearing. The helicopter will do what ever I tell it, but It seems like as soon as I get within 100 meters or so, it goes poof. And yes, it is fun to watch the AI fall to their deaths, but that's not what i'm going for. :) Any help I could get would be greatly appreciated. Thanks! Link to comment Share on other sites More sharing options...
mgm Posted March 22, 2015 Report Share Posted March 22, 2015 Thanks- It is working now. I have a feeling the setVToken is what allowed it to stay. Funny thing now is when the crew sees me approach, it moves away. I'll get all that handled in the script though. Thanks very much for your responses. That's right. I had the same issue, added setVToken line and auto-immediate-deletion stopped. (I have not added the other line "EPOCH_server_vehicleInit"). Link to comment Share on other sites More sharing options...
stratusc Posted March 22, 2015 Report Share Posted March 22, 2015 mgm, I tried that, and still the chopper goes poof. Not immediately...just when it gets within a few hundred meters of me. Link to comment Share on other sites More sharing options...
mgm Posted March 22, 2015 Report Share Posted March 22, 2015 mgm, I tried that, and still the chopper goes poof. Not immediately...just when it gets within a few hundred meters of me. are you using stock Epoch AntiHack? do you have anything at all in server-side RPT log? Link to comment Share on other sites More sharing options...
stratusc Posted March 22, 2015 Report Share Posted March 22, 2015 are you using stock Epoch AntiHack? do you have anything at all in server-side RPT log? I am using stock antihack. Even when I disabled it, the vehicle disappeared. Also, there is nothing related in my RPT log. I do have SEM and A3EAI running and some additional scripts. I'll start disabling those and see what happens. Thank you much for helping.... I really appreciate it. Any other ideas? Link to comment Share on other sites More sharing options...
mgm Posted March 22, 2015 Report Share Posted March 22, 2015 I am using stock antihack. Even when I disabled it, the vehicle disappeared. Also, there is nothing related in my RPT log. I do have SEM and A3EAI running and some additional scripts. I'll start disabling those and see what happens. Thank you much for helping.... I really appreciate it. Any other ideas? Sorry, nothing else comes to mind. As I said, the only time I run into an issue was resolved with this > _veh call EPOCH_server_setVToken; If you already have that line I don't have any further fixes. Disabling other scripts to test is a good idea, though. Good luck. Link to comment Share on other sites More sharing options...
stratusc Posted March 22, 2015 Report Share Posted March 22, 2015 Sorry, nothing else comes to mind. As I said, the only time I run into an issue was resolved with this > _veh call EPOCH_server_setVToken;If you already have that line I don't have any further fixes. Disabling other scripts to test is a good idea, though. Good luck. Well, still no luck. Starting with a PURE vanilla epoch server build with stock AH turned off and one script called from onPlayerRespawn.sqf ... _SpawnBoxPosition = [23600.4,18001,0]; _InitSpawnPosition = getposATL player; _supplyHeli = createVehicle ["C_Heli_Light_01_civil_F", _SpawnBoxPosition , [], 200, "FLY"]; _supplyHeli call EPOCH_server_setVToken; createVehicleCrew (_supplyHeli); _supplyHeli move _InitSpawnPosition; ...and when the chopper gets close.....BAM. I have two AI falling on me. LOL Again, MGM... Thank you for your help! Maybe someone else will come along that can add some input. :) Link to comment Share on other sites More sharing options...
KiloSwiss Posted March 22, 2015 Report Share Posted March 22, 2015 Run the script serverside and check the rpt logs for errors. mgm 1 Link to comment Share on other sites More sharing options...
elbabar Posted March 22, 2015 Report Share Posted March 22, 2015 Link to comment Share on other sites More sharing options...
mgm Posted March 23, 2015 Report Share Posted March 23, 2015 I wasn't aware you were trying to run this on client-side - good suggestion from KiloSwiss running it on the server-side. Hope it's sorted now? Link to comment Share on other sites More sharing options...
stratusc Posted March 24, 2015 Report Share Posted March 24, 2015 Wow... Thank you everyone! I modified the scripts mentioned in the posts by elbabar and now have the vehicles spawning on server start and acting the way I want.... For the life of me I cant figure out how to fire off the script by a client action though. I have to admit that I am pretty new at this and maybe should just walk away! LOL... I've been researching event handlers and public variables, but i can't seem to wrap my head around it. Maybe someone has an example they could point me to? Ultimately, what I am playing with is when a player dies and respawns, if they have a parachute on their back when they teleport (parachute provided by a loadout script), they respawn in the cargo bay of a helicopter moving from waypoint to waypoint all over the map. It seems i have it all working except the part where the player is put in the cargo of the helicopter. Too ambitious? Again... Thank you all for the help you have provided so far! :) Link to comment Share on other sites More sharing options...
1Man Posted March 24, 2015 Report Share Posted March 24, 2015 I don't know if it's possible to spawn inside a moving object, maybe if you use a special chinook arma 3 classname which means it would be the only one on the map it might be possible. Link to comment Share on other sites More sharing options...
KiloSwiss Posted March 24, 2015 Report Share Posted March 24, 2015 Give the vehicle a name like "bruno" and use player moveInCargo bruno. Or You could replace "bruno" with "spawn_heli" or something similar. Greez KiloSwiss Link to comment Share on other sites More sharing options...
stratusc Posted March 24, 2015 Report Share Posted March 24, 2015 Give the vehicle a name like "bruno" and use player moveInCargo bruno . Or You could replace "bruno" with "spawn_heli" or something similar. Greez KiloSwiss Yep....What worked for me is... _supplyHeli setVehicleLock "UNLOCKED"; Player assignAsCargoIndex [_supplyHeli, 0]; Player moveInCargo _supplyHeli; And for me, as soon as the player moved to the helicopter is disappeared. Still working on learning how the code. :) I feel as if when i create the object, i need to give it a global variable name. Then when the client script get triggered, it has a variable (eg: _supplyHeli) to use. Am I on the right track? Sorry for being such a noob! LOL Link to comment Share on other sites More sharing options...
mgm Posted March 24, 2015 Report Share Posted March 24, 2015 Yep....What worked for me is... And for me, as soon as the player moved to the helicopter is disappeared. Still working on learning how the code. :) I feel as if when i create the object, i need to give it a global variable name. Then when the client script get triggered, it has a variable (eg: _supplyHeli) to use. Am I on the right track? Sorry for being such a noob! LOL this might be too obvious but you said you're very new so: you do know that any variable name beginning with the underscore character is automatically a local variable, right? on the goal: I think you're on the right track, you will need to do testing and tweaking till it works though. unless somebody else has coded the exact same script, it's difficult to say whether it will work or not. it might be a better utilization of your time if you search the web and sites like armaholic for a working in-vehicle spawn script. give credits and take tested code. about 150x faster method for new scripters. Link to comment Share on other sites More sharing options...
stratusc Posted March 28, 2015 Report Share Posted March 28, 2015 Hey everyone... I got it working!!!! In summary, I created a .PBO in the addons folder that creates the vehicle and it stays put. Then I use event handlers, global variables and client side scripts to interact with it. If anyone wants more specifics on exactly what I did, feel free to message me!! ...and now onto other scripts! Thank you all again for your help in pointing me in the right direction. I learned quite a bit! Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now