Jump to content

meatball

Member
  • Content Count

    734
  • Joined

  • Last visited

  • Medals

Posts posted by meatball


  1. So, I'm working on a simple paradrop script that the players can use through an addaction that checks their backpack/contents and throws all that into an array, swaps their backpack for a parachute, teleports them to the drop zone, and then swaps the parachute for their backpack/contents on landing. I've got a few final things I'm trying to work out and wondering if anyone has any ideas.

    1) When I swap the backpack for the parachute, I just to a removebackpack player; player addBackpack "B_Parachute"; and it works fine. One caveat. It just drops the old backpack right on the ground. Any thoughts on how I can delete it as opposed to dropping?

    2) One option I'm building in is the capability for JIP players to drop on the team already in progress. It was a simple matter of just setting the drop coordinates to (leader groupname). But I came up with a problem using that. If the JIP players is actually the highest ranking role in the squad, they drop at their own location. :) Any thoughts on how I can set the drop location to where the bulk of the team is at easily?


  2. Thats exactly what I did but 2 explosive charges still destroyed the bridge, I think there maybe something more to this.

    Hmm, that's strange, maybe something is a bit off. The only other thing I can think of is maybe the bridge has more than one part to it and the nearestbuilding is only grabbing one of them. I have seen that if you place 2 charges on the bridge deck, it'll usually take a bridge down, but it takes a _lot_ more to blow out the pylons from underneath.

    Maybe something else is going on though in your case. I've not seen bridges drop on their own, but I've not run anything 24x7 either.


  3. It should work if you put it all into the same game logic. Like tryteyker said, create the gamelogic and then place it right next to, or even on top of the bridge ID # (click on the ID button in the editor up top.) Then in the game logic init field put:

    bridge = nearestBuilding this;bridge allowdamage false;
    

    That should do it. You can copy / paste that for other bridges, just make sure you change 'bridge' to bridge2, bridge3, etc., for each new one. You can use the exact same setup to say pre-damage buildings/objects by swapping out 'bridge allowdamage false;' to 'bridge setdamage ##;'


  4. Just tested it out and everything is working perfectly, great work aero!

    One thought for possible future versions. Maybe have it so regardless of the time, items don't get deleted if there's any player within x meters of it (maybe X could be a parameter that can be set within the script call). This way object don't just pop out of existence right next to players if they're hiding behind them for cover or something.


  5. Aeroson, that's awesome, thanks! Really appreciate this awesome script!

    Quick question, is there any way that it's possible for vehicles that are repaired to be removed from the list awaiting cleanup? That crew check definitely fixes the problem of repaired vehicles disappearing with people in them, but what about a repaired vehicle that you drive somewhere and then get out? Really don't want that to get deleted as soon as everyone hops out either.

    I also noticed that the 100m check doesn't seem to apply to the vehicle/body checks. That by design?


  6. Yeah, I'm finding the setDamage doesn't work well. Often as soon as you wreck a vehicle enough to make canMove true it blows up. I'll test with the crew count.

    Only downside I can think of doing the crew count is the vehicle will still probably get nuked as soon as everyone gets out.


  7. Yeah, I'm digging in the code a little bit and it looks like it parses through every vehicle in game looking to see if it's actually a player or if it can move:

    if (_ttdVehiclesImmobile>0) then {		
    	{
    		if(!isPlayer _x && !canMove _x) then { 	 
    			[_x, _ttdVehiclesImmobile] call _delete;
    		}; 
    	} forEach vehicles;
    };
    

    So, it looks like it looks at every vehicle every so often and if it's immobile/!player it throws it in an array called _objects. I'm just having trouble following the actual deletion of the object. If I can't figure out how to reset the flag on a vehicle once it's repaired, maybe I can at least figure out how to set immobile vehicles to blow up (setdamage 1) after a really short period of time so they're not lying around forever for people to repair.

    ---------- Post added at 04:03 ---------- Previous post was at 03:56 ----------

    Think I'll try that, I'm going to set immobile vehicles to get 'deleted' after a relatively short period of time (120 seconds) and then change the actual delete block in the script to this:

    {        
    	if(isNull(_x)) then {
    		_objects set[_forEachIndex, 0];
    		_times set[_forEachIndex, 0];
    	} else {
    		if(_times select _forEachIndex < time) then {
    			if(!isPlayer _x && !canMove _x) then {
    			_x setDamage 1;
    			} else {
    			deleteVehicle _x;
    			};
    			_objects set[_forEachIndex, 0];
    			_times set[_forEachIndex, 0];			 	
    		};
    	};	
    } forEach _objects;
    

    Assuming I'm doing this right, what should happen is every 2 minutes, any immobile vehicles around blow up. Which hopefully will keep players from finding them. Of course...if they do find them and happen to be in them... <BOOM>

    Wish I could think of a better way to do it, but it's really goofy when players are driving a repaired vehicle around and then suddenly it disappears out from under them and the drop to the ground.


  8. On our dedicated server when we start a mission and say 6 of us join everything is fine - then an hour later player 7 joins we have noticed player 7 doesnt have the revive option - to solve the problem what we do is ALL disconnect and then all 7 players reconnect at the same time and everything is fine. Then again if an eigth player joins they too dont have the revive option and we all disconnect and reconnect and everything is fine - any ideas anyone?

    Thanks in advance

    We've been seeing the same thing. Not sure if it's a problem with JIP players not running the revive_init for some reason and not initializing BTC, or some sort of problem with BTC no recognizing this new person is part of the same 'group' and they should be able to revive/be revived.


  9. createUnit is a global command it will spawn units. Did you create a Center and a group before you tried to create the units?

    Yes, I'm actually using spunFin's AI Spawn script pack, the militarize script in particular. This will create both a center and the groups before the createUnit is run. Though some creative use of hints, variables and radio triggers I've been able to actually watch the headless client run the militarize scripts, create the groups, but it just doesn't create the units, or it's creating them and not synchronizing them off the HC for some reason. Meanwhile the exact same setup works perfectly fine if I run the AI calls from a dedicated server or locally hosted server.

    ---------- Post added at 00:02 ---------- Previous post was at 23:42 ----------

    Think I got it. It's a mess, but it's working. Basically I had to throw a bunch of if/thens into init.sqf to check whether or not there was a HC, etc., and it seems to be working now. Thanks everybody for the help!


  10. @Naught, I'll try that, must be the fact I used name in the in the init.

    @Johnson11B2P, I've already tried that. The HC executes the script file with all the AI script calls, but the AI script uses createUnit and I'm guessing there's some sort of locality problem with that. I can watch the HC run the script and actually create the groups for the units, but the units themselves never spawn on the dedicated server/connected clients.


  11. I'm having a bear of a time trying to hand off some AI to a headless client using setOwner. I know setOwner needs to be run on the server and I've tried running this on the server as it creates the AI units in script:

    unit setOwner (owner hcName);
    

    Where hcName is the actual name of the headless client I create during init using:

    if (!hasInterface && !isServer) then{
    hcName = name player;
       publicVariable "hcName";
    };
    

    I've found a few threads about clientID and setowner that don't pertain to what I'm doing. And I've also previously tried to actually spawn the AI directly on the HC and can't seem to get that working, so I've dropped back to try using setOwner.


  12. Done a little bit more experimenting and think I know the problem, just not sure how to handle it. I know for certain that milCache.sqf is being run by the Headless Client. Which leads me to believe that for some reason a script spawning AI on a client that is not the server will not show up globally and the AI either just isn't being created at all, or it's only being created on the Headless Client. I have gone through the scripts and removed the 'if (!isServer)exitWith{};', so the script should definitely run.

    Update: Bit more testing and I can actually see the militarize script creating the groups on the headless client, but it's creating empty groups for some reason. The script uses createUnit for infantry and createVehicle for vehicles, which I believe should both work fine in MP situations.


  13. Man, this is starting to drive me batty. So, I've started to rethink how I'm going to go about this. I've not setup the parameter to choose Headless Client On/Off and then I added this into my init.sqf.

    if(paramsArray select 4 == 1) then{
    if(isServer) then{
    	hcPresent = true;
    	publicVariable "hcPresent";
    };
    if (!hasInterface && !isServer) then{
    	hcName = name player; 
    	publicVariable "hcName";
    };
    } else{
    if(isServer) then{
    	hcPresent = false;
    	hcName = "NOONE";
    	publicVariable "hcPresent";
    	publicVariable "hcName";
    };
    };
    
    ....Other code....
    
    if(hcPresent) then{
    if(!hasInterface && !isServer) then{
    	milSet = 1;
    	publicVariable "milSet";
    	execVM "miscScripts\milCache.sqf";
    };
    } else {
    if(isServer) then{
    	milSet = 2;
    	publicVariable "milSet";
    	execVM "miscScripts\milCache.sqf";
    };
    };
    

    I set that milSet/variable so I could run a radio trigger to be certain the right code block was running and it all looks good. milCache.sqf is simply a bunch of calls to my AI spawn script of choice (AI Spawn Script pack) and looks something like this:

    nul = ["task_60",2,450,[true,false],[false,false,false],false,(0.1*numEnemies),0,enemySkill,nil,"miliTroops = group this;",60] execVM "LV\militarize.sqf";
    sleep 3;
    nul = ["task_17",2,150,[true,false],[false,false,false],false,(0.166*numEnemies),0,enemySkill,nil,"miliTroops = group this;",17] execVM "LV\militarize.sqf";
    sleep 3;
    ...
    

    So, here's the results:

    Situation 1: Locally hosted server with HC param off I get hcPresent false, hcName Noone and milSet 2, AI spawn as expected.

    Situation 2: Dedicated server with HC param off I get hcPresent false, hcName Noone and milSet 2, AI spawn as expected

    Situation 3: Dedicated server with HC param on and HC connected I get hcPresent true, hcName hc (name of my connected hc) and milSet 1, AI never spawns.

    So in Situation 3 where the headless client should be running milCache.sqf, for some reason the AI just never spawn and I'm not sure where to go from here. Any thoughts would be mucho appreciated.


  14. Is it possible to have a mission init.sqf autodetect whether there's a HC connected and broadcast that as opposed to relying on parameters? I was thinking along the lines of something like this as the first lines of the mission init.sqf:

    if (!hasInterface && !isServer) then{
        hcPresent = true;
        publicVariable "hcPresent";
    } else {
        hcPresent = false;
        publicVariable "hcPresent";
    };
    

    Any reason why that wouldn't work? If it does, then you could pretty easily use the hcPresent variable to determine whether AI spawn calls run on the server or the HC.


  15. Thanks. I've been thinking on this for the last hour or so, and I'm wondering if I can make this work without too much effort. I've got my dedicated server, and I've got a headless client setup. I've set my mission up so it has a Civilian slot for the Headless Client and set up a parameter I can select at the briefing screen that will set a global variable "HCPresent" to true or false based on that the parameter selection. I've tested it out and assuming I connect and login as admin first, the HC connects and grabs the civvie slot correctly.

    So, looking at everything, I now have a global variable that I can reference in game as to whether or not there's a HC connected, and I should be able to grab that HC profile name/client ID since I know the slot it's in.

    Since almost every AI and the caching script I have in the game is created by simple triggers spawning the AI script call, there _has to be_ a way I can configure the triggers to run only the scripts on the Headless client if it's connected, or run them on the server if it's not.

    I'm wondering if I duplicate every trigger and set one to have conditions of "(HCPresent==false) and isServer" and the other to have "(HCPresent==true) and (clientID==HCID)"

    Of course, the more I'm diving into this, the more I'm thinking it might just be easier to figure out how to integrate your script in and save myself a lot of headaches ;)


  16. Hey Naught, I actually saw that and it looks awesome, but I don't know if it'll work in my case.

    Specifically I've already got caching set and ready, I just want to offload the AI processing to a HC. Plus I need to be able to count numbers of AI being cached and cache/support AI vehicles (mostly using spunFin's AI Spawn Script Pack ambientcombat and militarize scripts). Other challenge is that CBA is required. Not that I don't use CBA, I've just been trying to avoid forcing people to use any addons for my missions.

×