Jump to content

satory

Member
  • Content Count

    20
  • Joined

  • Last visited

  • Medals

Posts posted by satory


  1. Hey everyone, I have a script which I made, with help from a previous thread on this board. But I have a problem with it its grand when I preview a mission, but once I upload the mission onto a server it doesn't work at all.

    The script is called on every playable characters init box like so,

    nul=[this] execVM "ChangeW.sqf"

    And the script itself is:

    _punit = _this select 0;
    _unittype=typeof _punit;
    
    
    
    removeAllWeapons _punit;
    _punit addWeapon "Binocular";
    _punit addWeapon "NVGoggles";
    
    
    
    switch (_unittype) do
    {
    case "USMC_Soldier_AT":
    {
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addWeapon "M4A1_AIM_SD_camo"; 
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addWeapon "M9SD"; 
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "SMAW_HEAA";		
    	_punit addWeapon "SMAW"; 
    	_punit addMagazine "SMAW_HEAA";
    	_punit addMagazine "SMAW_HEDP";
    	_punit addMagazine "HandGrenade";
    	_punit addMagazine "HandGrenade";
    
    };
    case "USMC_Soldier_SL":
    {
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addWeapon "M4A1_AIM_SD_camo"; 
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addWeapon "M9SD"; 
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "SmokeShell";
    	_punit addMagazine "SmokeShell";
    	_punit addMagazine "SmokeShellGreen";
    	_punit addMagazine "SmokeShellRed";
    
    
    };
    case "FR_Sapper":
    {
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addWeapon "M4A1_AIM_SD_camo"; 
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addWeapon "M9SD"; 
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "Pipebomb";
    	_punit addMagazine "Pipebomb";
    	_punit addMagazine "Pipebomb";
    };
    case "USMC_Soldier":
    {
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addWeapon "M4A1_AIM_SD_camo"; 
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addWeapon "M9SD"; 
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "HandGrenade";
    	_punit addMagazine "HandGrenade";
    };
    default 
    {
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addWeapon "M4A1_AIM_SD_camo"; 
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addWeapon "M9SD"; 
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "15Rnd_9x19_M9SD";
    	_punit addMagazine "HandGrenade";
    	_punit addMagazine "HandGrenade";
    
    };
    }	
    
    
    
    
    

    What do I need to change to make it work for MP?


  2. Ok I'm going to assume that since there is no mention of my script in the RPT file its not actually being run?

    Here is my RPT file,

    =====================================================================

    == E:\Bohemia Interactive\ArmA 2\arma2.exe

    == "E:\Bohemia Interactive\ArmA 2\arma2.exe"

    =====================================================================

    Exe timestamp: 2009/07/01 03:58:29

    Current time: 2009/07/12 22:50:26

    Error: JoystickDevices - CoInitilizeEx return 80010106

    Error: CoInitilizeEx (XAudio2-1st trial) return 80010106

    Exe version: 1.02.58134

    barracks1 is not soldier nor transport.

    No transport

    UnExpected call of CreateVehicle for 'Logic', pos(0.000000.2,0.749948.2,0.000000.2). Vehicles with brain cannot be created using 'createVehicle'!

    Creating debriefing

    If that is so the case, and the script is not being run can some one point me in the right direction?

    Here is the players init field:

    this moveincargo boat1; nul=[this] execVM "ChangeWeapon.sqf"

    note the playable unit starts off in a boat.

    And here is a copy of the script, its called ChangeWeapon.sqf

    _punit = _this select 0;
    _unittype=typeof _punit;
    
    
    
    removeAllWeapons _punit;
    
    
    switch (_unittype) do
    {
    case "USMC_Soldier_AT":
    {
    	_punit addWeapon "M4A1_AIM_SD_camo"; 
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    };
    case "USMC_Soldier_SL":
    {
    	_punit addWeapon "M4A1_AIM_SD_camo"; 
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    };
    case "FR_Sapper":
    {
    	_punit addWeapon "M4A1_AIM_SD_camo"; 
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    };
    case "USMC_Soldier":
    {
    	_punit addWeapon "M4A1_AIM_SD_camo"; 
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    };
    default 
    {
    	_punit addWeapon "M4A1_AIM_SD_camo"; 
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    	_punit addMagazine "30Rnd_556x45_StanagSD";
    };
    }	
    
    

    Oh, one question, do scripts have an 8.3 filename limit?

    ---------- Post added at 11:14 PM ---------- Previous post was at 11:06 PM ----------

    Oh, one question, do scripts have an 8.3 filename limit?

    :(:(:(

    I think this has solved my problem...

    Thanks all who helped!!!!


  3. Yeah dropping the "" on the player classes in the switch statement didnt do anything.

    Just before I do anything else, this is the right code iin the units init?

    nul=[this] execVM "ChangeWeapon.sqf"

    With ChangeWeapon.sdf being the name of the script? and this being the first argument.

    ---------- Post added at 12:24 PM ---------- Previous post was at 10:25 AM ----------

    Okay, typeof definitely works as I've used it to return a string to the screen.

    So somewhere along the line of my unit entering the script it falls apart, since it doesn't actually remove all weapons before entering the switch/case statement.


  4. Cheers Ghost, I have that link up in one of my tabs all ready, what I'm looking for is the condition for the case statement?

    The code in the OP was just written quickly to try and give people an idea of what I'm looking to do.

    I'm at work at the moment so I don't have everything with me, but here is a more syntax proper example

    _pUnit = _this select 0;
    
    removeAllWeapons _pUnit;
    
    
    
    switch (CONDITION?) do {
    case "USMC_Soldier_AA" : {
    _pUnit addWeapon "M4A1_AIM_SD_camo"; 
    _pUnit addMagazine "30Rnd_556x45_StanagSD";
    };
    case "USMC_Soldier_Medic" : {
    _pUnit addWeapon "M4A1_HWS_GL_SD_Camo"; 
    _pUnit addMagazine "30Rnd_556x45_StanagSD";
    };
    };


  5. First off I'm probably blind, and its been looking back at me all this time, but I cant see what Im looking for...

    My plan is to write a script that will change the teams weapons to silenced ones.

    I want to write a case statement that checks a players class/role on the team, so for example

    Switch(class/role)
    {
    "USMC_Soldier_AA": blah blah
    
    "USMC_Soldier_Medic": blah blah
    }

    I'd like to run the case statement against the names in this thread

    I have been using this page here and staring at it for ages but I cant see what I'm looking for, any suggestions?


  6. Edit:

    I see what you're trying to do (I read the topic heading!), try this:

    - change the Precense type of the trigger to NOT PRESENT

    - then have the following in the condition:

    this&&!(alive Jim)

    Yeah thats what I had at first, though the problem is that if the player kills "Jim" when he's at his destination then the trigger is activated. Im hoping to make sure that even if they kill "Jim" when he's at his destination then its too late and they wont complete the objective?


  7. Im looking at setting up a Convoy mission, basically the USMC team has to stop a convoy from reaching, for this example Gorka.

    I've created a trigger around Gorka and called it trigger1, and set it to presence and the condition has been set to the name of the unit, for example Jim. I think im mission something here, rather than in the next bit.

    I have create a second trigger and made it emcompass the entire route of the convoy, I have set the condition to:

    !(triggger1) && !(alive Jim)

    From my basic understanding since trigger1 hasn't activated and if Jim gets killed this should be set off but for some reason it is not doing that.

    Where am I going wrong?


  8. Hi, I recently with the help of a forumite got a trigger to work and help start to move a convoy.

    Now the convoy is set to move down the east hand side of Cheranrus? along the main road. Is it possible to grab the current game time, and add, for example 2 hours to it and push that into a trigger, so that one trigger makes sure that the convoy didn't reach destination and that a bigger trigger makes sure that after the time, plus 2 hours that the convoy is not alive? This will help push the attacking team into destroying the convoy, rather than picking a spot and setting up an ambush in their own time, so long as the first trigger isn't meet?


  9. Hey Rommel using that script now with the position variable set to "getpos _this select 0"

    Please bare in mind that im new to this game series, and to creating missions in general, but

    The issue I'm having is the Humvee still existing? and so a new one doesn't seem to appear. For example I laid down a sachel charge and blew it up, then after a while decided to lay another, but still it exists, though its wrecked? Should your script still respawn a Humvee in this case?

×