Page 1 of 5 12345 LastLast
Results 1 to 10 of 49

  Click here to go to the first Developer post in this thread.  

Thread: Some questions about the Arma 2 scripting engine.

  1. #1

    Some questions about the Arma 2 scripting engine.

    At first tnanks a lot for not banning me for questions probably already answered here on this forum. I've used search but unhopefully found nothing, so posting here.

    I have got next questions during the make of my first big project:

    1) How can I delete vehicle from the gameworld with the driver inside? When I use deleteVehicle on the vehicle with the driver created in the editor vehicle disappears and driver falls down. =) I want him disappear aswell.

    Do the driver of the created vehicle have the same group as the entire vehicle? If so - can I delete both vehicle and driver with something like:

    Code:
    // If I want to delete _the_unit_to_be_deleted with the dirver inside:
    _units_list = units group _the_unit_to_be_deleted;
    "deleteVehicle _x" forEach _units_list;
    Ore something like that. For me it did not work. =(

    2) How can I create markers only visible to one side and invisible for another (multiplayer).

    3) Can I create separate introes, separate briefings and objectives for different sides? (multiplayer)

    and one more

    4) Can I make squad-specific respawn markers? So only one group will be spawning there. And if so is there any way to grant user an ability to choose his spawn location? For exampla base or this squad-specific marker.
    Last edited by DiRaven; Jun 8 2009 at 19:17.

  2. #2
    Chief Warrant Officer
    Join Date
    Jan 17 2004
    Location
    Auckland, New Zealand
    Posts
    3,788
    The first one is easy, so I'll answer that.
    Use the 'crew' command to get an array of whoever is in the vehicle.

    _crew=crew myvehicle;
    {deletevehicle _x} foreach _crew;

    The rest gets more complex, and as I don't usually do MP stuff I'll let someone else help with that.

    By the way this is the ArmA section, not ArmA 2. Maybe a mod can move this thread for you.
    Edit: Looks like it was moved.
    Last edited by Maddmatt; Jun 9 2009 at 04:17.

  3. #3
    Check out the Arma1 scripting topics, especially the sticky ones on the top:
    Arma1 Scripting Topics

    You'll quickly learn that scripting for multiplayer can be tricky, especially of you're new to the language and locality issues of the commands.

    2) I've never done it, as I'm into coops only. But I'll suggest downloading some Arma1 multiplayer missions and see how its done.

    3) See #2.

    4) As for respawn, I'd go with base respawn for each side. After respawn you can teleport the player to the position of the current leader of the squad or a location of your choosing if the position is to be dynamic.

    Welcome and good luck. Jumping straight into multiplayer editing is bold
    Regards
    Carl Gustaffa - left this game due becoming Steam Exclusive

  4. #4
    Gunnery Sergeant
    Join Date
    Jul 23 2005
    Location
    Germany/Lower Saxony/
    Posts
    504
    You also can take a look into Mr-Murray Editing Guide. There´s a bunch of information in it. A book for A2 will follow later but you can use it as well.

    You find the book in my signature...
    ArmA3 Bugtracker

    ArmA Editing Guide Deluxe Edition - English Version Download
    ArmA Editing Guide Deluxe Edition - German Version Download
    try my Weaponbox signs Addon
    My System
    Google Earth Topomap (heightmaps downloaden)
    I am a Member of the Voiceacting group, so if you need voices with german accents, let me now

  5. #5
    2) How can I create markers only visible to one side and invisible for another (multiplayer).
    Create the markers via script. Create them local and check the side of the player.

    Code:
    if (side player==west) then {
    _marker = createmarkerlocal getpos westbase;
    } else {
    _marker = createmarkerlocal getpos eastbase;
    };
    3) Can I create separate introes, separate briefings and objectives for different sides? (multiplayer)
    Yes , Dont Know, Yes.
    For seperate intro and objective for each side just place a "sidecheck" like the markerthing in the introcamscript or the init/script that activates the objectives.
    I think there was a way to make briefings for each side since OFP, but i cant remember it anymore.


    4) Can I make squad-specific respawn markers? So only one group will be spawning there. And if so is there any way to grant user an ability to choose his spawn location? For exampla base or this squad-specific marker.
    Place a script called onplayerkilled.sqs in your mission directory. It will execute if the player dies.
    Write
    Code:
    waituntil {alive player};
    in the script. If the player dies, the script will wait until he respawn. After that you can simply make a setpos to another location or do anything else with the repawned player.

  6. #6
    Ou dear... Thanks for answers... Big sorry for the delay, had problems with the internet almost a week. I will check all the tips asap. Thanks again. =)

    ---------- Post added at 01:14 PM ---------- Previous post was at 12:25 PM ----------

    Quote Originally Posted by CarlGustaffa View Post
    Check out the Arma1 scripting topics, especially the sticky ones on the top:
    Arma1 Scripting Topics

    ou'll quickly learn that scripting for multiplayer can be tricky, especially of you're new to the language and locality issues of the commands.
    Will do. Thanks. =)
    Quote Originally Posted by CarlGustaffa View Post
    2) I've never done it, as I'm into coops only. But I'll suggest downloading some Arma1 multiplayer missions and see how its done.
    Already done. Coding styles are very different. And my goal is to find good solution which will be reworked and reused, not that "copy-paste" programming.

    Quote Originally Posted by CarlGustaffa View Post
    3) See #2.

    4) As for respawn, I'd go with base respawn for each side. After respawn you can teleport the player to the position of the current leader of the squad or a location of your choosing if the position is to be dynamic.

    Welcome and good luck. Jumping straight into multiplayer editing is bold
    Thanks again. =) I'm working on a huge project that looks like Domination but is more complex.

    Quote Originally Posted by MemphisBelle View Post
    You also can take a look into Mr-Murray Editing Guide. There´s a bunch of information in it. A book for A2 will follow later but you can use it as well.

    You find the book in my signature...
    Downloading. Thanks.

    Quote Originally Posted by NeoArmageddon View Post
    Create the markers via script. Create them local and check the side of the player.

    Code:
    if (side player==west) then {
    _marker = createmarkerlocal getpos westbase;
    } else {
    _marker = createmarkerlocal getpos eastbase;
    };
    Will check it out. It is the way I thought it to be done. Just expected there are already ready functions like "Add marker for OPFOR" =)

    Quote Originally Posted by NeoArmageddon View Post

    Place a script called onplayerkilled.sqs in your mission directory. It will execute if the player dies.
    Write
    Code:
    waituntil {alive player};
    in the script. If the player dies, the script will wait until he respawn. After that you can simply make a setpos to another location or do anything else with the repawned player.
    Perfect tip. Thanks a lot.

    ---------- Post added at 01:19 PM ---------- Previous post was at 01:14 PM ----------

    Quote Originally Posted by Maddmatt View Post
    The first one is easy, so I'll answer that.
    Use the 'crew' command to get an array of whoever is in the vehicle.

    _crew=crew myvehicle;
    {deletevehicle _x} foreach _crew;
    Exactly what I asked. Big thanks. =)

  7. #7
    Originally Posted by NeoArmageddon

    Place a script called onplayerkilled.sqs in your mission directory. It will execute if the player dies.
    Write
    Code:
    waituntil {alive player};
    in the script. If the player dies, the script will wait until he respawn. After that you can simply make a setpos to another location or do anything else with the repawned player.
    Thats wrong! I forgot, that onplayerkilled.sqs just works if the player dies permanently. I just ave the problem on an own map. But there is another solution.

    Write in you init.sqf:

    Code:
    _handlerid = player addEventHandler ["killed", {_this execVM "playerkilled.sqf"}];
    This will work, like my mentioned above. Here is my "playerkilled"-script for comparision/copying:

    Code:
    waituntil {(alive player)};
    
    if (side player==East) then {
    
    player setpos getpos Jail;
    
    } else {
    
    _spawns=MBG_locsReal-[Logic_6];
    _sp = _spawns select floor(random(count(_spawns)));
    player setpos getpos _sp;
    
    };

  8. #8
    Quote Originally Posted by MemphisBelle View Post
    You also can take a look into Mr-Murray Editing Guide. There´s a bunch of information in it. A book for A2 will follow later but you can use it as well.

    You find the book in my signature...
    Have read this stuff hardly. Really awesome work... Covers a lot of my questions. Thanks once more.

  9. #9
    Got next question.

    While trying to execute:
    Code:
    for "_i" from 0 to 9 do
    {
        player globalChat format["%1",_i];
    };
    I'm always getting result as "Any"... One chat message with the ANY word. Any suggestions?

  10. #10

Page 1 of 5 12345 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •