Jump to content

feldruebe

Member
  • Content Count

    22
  • Joined

  • Last visited

  • Medals

Posts posted by feldruebe


  1. hey guys,

     

    i have created a gamemode for dedicated servers, but right now its not possible to continue it after the server shut down.

    Before we tested on a dedicated server, the mission was meant to be hosted directly from arma, so we could hit "save & exit" but that obviously didnt work.

    Here comes my question: what stuff needs to be stored in my database and what gets saved by arma?

    There are quite some scripts with many variables that need to be saved, as well as the position of vehicles on the map and their condition.

     

    Hope you guys can help me. Thanks in advance


  2. 2 minutes ago, Larrow said:

    Who's in the plane? AI or client?

    Why add an action, then force the use of said action, then remove action? Why not just run the code the action performs from the waypoint statement?

    The plane is AI controlled

     

    About that action stuff: i made a script for a Useraction, and wanted to recycle it. The plane loads a cargobox (Action A), and when it passes the waypoint it should drop it (--> Action B).

    If I used execVM for this task i still would have the same problem, of "_plane" being undefined

     

    12 minutes ago, Larrow said:

    Works fine for me.

    • Open fresh VR map
    • Place down player
    • Place manned BlackWasp
    • Add to BlackWasps init...
    
    h = [ this ] spawn {
    	params[ "_plane" ];
    	systemChat str _plane;
    	_actionId = _plane addAction [ "todo", {
    		hint "Action Done";
    	}];
    	_wp = group driver _plane addWaypoint[ _plane getPos[ 500, getDir _plane ], 5 ];
    	_wp setWaypointStatements[ "true", format[ "_plane = %1 call BIS_fnc_objectFromNetId; _plane action[ 'User', _plane, %2 ];", str ( _plane call BIS_fnc_netId ), _actionID ] ];
    };

    Plane starts to taxi towards waypoint, when he gets within completion range you see the hint "Action Done".

    Gonna try that again some other day. Thanks for trying to help, maybe i'm just a bit too dumb at the moment :D


  3. 14 hours ago, Larrow said:
    
    _wp1 setWaypointStatements [
       "true",
       format[ "_plane = %1 call BIS_fnc_objectFromNetID; _plane action ['User',_plane,0]", str( _plane call BIS_fnc_netID ) ]];

    Use the BI functions and format its netID as STRING( str ) into the waypoint expression. Then convert it back into an object within the expression.

     

    Not tested and typed from my sofa on my HTPC with a PS3 controller via onscreen keyboard, oh the joy. So check for mistakes :) .

     

    tested it, same result.

    i also tested somethin similar;

    _wp1 setWaypointStatements ["true", str(_plane) + " action ['User',_plane,0]"];

    but it says, that it misses a semicolon :C


  4. i want a plane to perform an action, when it reaches a checkpoint, but it wont.

    When it reaches the Waypoint, nothing happens, it just flies on to the next waypoint.

     

    Here is the line that keeps on breaking the script;

    _wp1 setWaypointStatements ["true", str(_plane action ["User",_plane,0])];

    everything else in the script works fine. Only thing i am not sure about is, whether i have to take a "0" or a "1" in the end, because before the part above, there is an action added to the plane and removed again.

    What is wrong with performing the action?


  5. 17 hours ago, killzone_kid said:

    try


     

    
    _plane addMPEventHandler ["MPKilled",
    {
    	_plane = _this select 0;
    	removeAllActions _plane;
    	if (!local _plane) exitWith {};
    	_plane removeMPEventHandler ["MPKilled", _thisEventHandler];
    	Transplanealive = false;
    	publicVariable "Transplanealive";
    }];

     

    Ok thanks, it works! But how?

    I guess _plane = _this select 0; redefines _plane in the eventhandler as the object the EH is attached to.

    But what is _thisEventHandler? The ID of this specific EH?

    And what is the line if (_plane not local) exitWith{}; doing?


  6. 1 minute ago, Midnighters said:

    Right, I'm not quite too sure either. Have you tried adding the event handler outside of the if statement?

    it'll fire similarly.

    Ok I tried it like this

    Spoiler
    
    _plane = _this select 0;
    _id = _this select 2;
    
    _plane addEventHandler ["Killed",{
    	Transplanealive = false;
    	publicVariable "Transplanealive";
    	removeAllActions _plane;
    	_plane removeEventHandler ["Killed",0];
    	}];
    		
    if (!Transplanealive) then {
    	Transplanealive = true;
    	publicVariable "Transplanealive";
    	_plane addAction ["load box","PATH"];
    	_plane addAction ["Airshow","PATH"];
    	_plane removeAction _id;
    	}
    	else {
    	hint "You already own a transportplane!";
    	};

     

    same results :\


  7. hi guys,

     

    im trying to attach an Eventhandler to a plane, so when it is destroyed, all usermade actions get removed.

    The script is run by an action.

    Here is the script:

    Spoiler
    
    _plane = _this select 0;
    _id = _this select 2;
    
    if (!Transplanealive) then {
    	Transplanealive = true;
    	publicVariable "Transplanealive";
    	_plane addAction ["load box","PATH"];
    	_plane addAction ["Airshow","PATH"];
    	_plane removeAction _id;
    	_plane addEventHandler ["Killed",{
    		Transplanealive = false;
    		publicVariable "Transplanealive";
    		removeAllActions _plane;
    		_plane removeEventHandler ["Killed",0];
    		}];
    	}
    	else {
    	hint "You already own a transportplane!";
    	};

     

    am i missing something?


  8. Hi guys,

     

    every time I try to work with the object builder, it keeps on crashing after some time has passed (like 2-10 minutes).

    It even keeps doing this while im not actually doing anything at all. I just tested opening the object builder and leaving it alone for some time --> same results.

    Am i missing some plugins for something? I really dont know what to do about that.

     

    Hopefully someone can help me. Cheers!

×