Jump to content

DryFire117

Member
  • Content Count

    9
  • Joined

  • Last visited

  • Medals

Posts posted by DryFire117


  1. 3 hours ago, bad benson said:

    you might want to check first, if the array already exists.

     

    
    0 = this spawn
    {
    	waituntil {!isNil "WMO_SpecialObjects"};
    
    	WMO_SpecialObjects pushback _this
    }

     

    not sure, if this will solve your issue. jsut guessing by what you showed. good luck.

     

    Nope that didn't work...I'm trying to get this mod to work with the USS Freedom.


  2. Hey all,

    Here's my problem: I have a script that is attached to a client action called client.sqf that looks like this:

    // THIS SCRIPT IS ON THE CLIENTS COMPUTER
    // run the actual bomb arm script from the server
    _obj = _this select 3 select 0;
    
    if (_obj == obj1) then {
    //THIS SHOULD EXECUTE armObj1.sqf ON THE SERVER
    [[[player,_obj],"armObj1.sqf"],BIS_fnc_execVM] remoteExec ["call",2,false];
    }; 

    The issue is that this does nothing. I'm not sure how to let the client tell the server to execute this script. If I set the target argument of remoteExec to 0 it runs locally on my client but that's not what I'm trying to do here. Any ideas? Here's the flow of the situation: Client triggers action -> action calls client.sqf locally on client -> client.sqf tells server to execute armObj1.sqf from client machine -> server does execVm "armObj1.sqf"


  3. I'm not too familiar with event handlers, but couldn't you just put 'player'? Or does 'this' have to refer to the actual soldier object?

    I know that in the init field of a unit in the editor you must use "this". So I guess you're attaching the event handler to the actual model itself.

     

    EDIT: I checked. You do use player in initPlayerLocal.sqf.


  4. I think you could also just put it in the initPlayerLocal.sqf right?

    It looks like it!

     

    I'm glad you mentioned that. The init boxes are great for getting started, but it makes your code less portable between different missions. Looks like I have some more editing to do ;)

     

    EDIT: Now that I think about it, I'm not sure how initPlayerLocal.sqf would work with the event handler. I guess it depends on when the script actually runs, and what "this" would be referring to.


  5. Unless you use a script outside of the editor I think you'll have to stick with using the 21 ands (which shouldn't be a problem, it just looks ugly). The stamina part depends on what type of mission you're creating. Do you have respawns for the player? Is it a single player or multiplayer mission? If there are no respawns for the player (single or multiplayer) then putting "player enableStamina false;" in the init field (without the quotes) of every playable unit will disable stamina. If there are respawns in a single player game, then put this in the init field of the playable unit: 

    player enableStamina false;
    this addEventHandler["respawn",{player enableStamina false;}];
    

    If this is a multiplayer game with respawns then put this in the init field of every playable unit:

    player enableStamina false;
    this addMPEventHandler["mprespawn",{player enableStamina false;}];
    

    I know this works because I just solved this issue for myself a couple hours ago :)


  6. I'd try something similar to this:

    _helipad = "Land_HelipadEmpty_F" createVehicle [0,0,0];
    _helipad attachTo [player, [0,30,0]]; // The second argument is the offset from the player
    
    _helipad say3d ["sounds\crying.ogg",30,1]
    

    So the sound will follow the player, and when the sound is done playing (or if you want to end it early) all you have to do is:

    deleteVehicle _helipad;
    

    However, it wont have the 3D positional audio effect that you're looking for. For that, the one option that sticks out to me is to compare the direction the player is facing to the direction from which you want the sound to play. Then its a matter of using the detach method on the helipad and reattaching it to the player at the proper offset. It sounds fairly complicated, but I'm a noob so there's probably a better way to do this!

×