Jump to content

Spinor

Member
  • Content Count

    208
  • Joined

  • Last visited

  • Medals

Posts posted by Spinor


  1. Another workaround would be at mission start to constantly (in a loop) check the position of say the first 50 markers;

    As soon as one of these is nonzero, you know the player has placed a marker and you have its index.

    Now you can normally track the placement of usermarkers.


  2. I think I just found the problem. As stated in the official command reference, you can use PublicVariable only for variables with types Number, Boolean, Object or Group.

    So I think

    TitleText ["Vehicle respawned", "PLAIN"];

    NewRespawnMessage = false; PublicVariable "NewRespawnMessage"

    should work.

    To make the message appear with the appropriate type you could submit the vehicle like

    SpawnedVehicle = _vcl; PublicVariable "SpawnedVehicle"

    in your respawn script and rewrite the Action of the trigger as

    TitleText [Format["Vehicle %1 has been repaired and returned to Base.", SpawnedVehicle], "PLAIN"];

    NewRespawnMessage = false; PublicVariable "NewRespawnMessage"

    although with a messy vehicle name.

    Hope this works,

    Spinor


  3. Slayer,

    your condition seems right to me, but what text do you use for the RadioAlpha.

    For you task try the following:

    Create the initialization script "init.sqs" (will be automatically called at mission start up) and write the following in it:

    ?(Side player) == west: 1 SetRadioMsg "Text for west action"

    ?(Side player) == east: 1 SetRadioMsg "Text for east action"

    This will define the text appearing for Radio Alpha depending on the side

    Make two triggers (activated by Radio Alpha) with your conditions:

    this AND (Side player == west)

    this AND (Side player == east)

    and make them activate whatever you want. Don't put anything in the Text field as this would overwrite the text we defined in the init.sqs.

    Hope this helps (and works),

    Spinor


  4. Hi,

    thats really a tricky one.

    One possibility would be to make _vcl a global variable, i.e. vcl and then make it public. But this wouldn't work if you want to use the script multiple times because they would all use vcl as variable and get messed up.

    I think the best way would something like DV Chris Death suggested: Keep the whole script local on the server (i.e. use the server condition at the head of the script) and somehow transmit only the spawn message to all computers. To do this I would suggest the following:

    Rewrite your respawn loop as follows:

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    #start

    ~1

    ?(Canmove _vcl):Goto "start"

    ~_respawndelay

    deleteVehicle _vcl

    _vcl = _type createVehicle _position

    _vcl setdir _dir

    NewRespawnMessage = true

    RespawnMessage = format["A %1 has been repaired and returned to Base.",_type]

    PublicVariable "NewRespawnMessage"

    PublicVariable "RespawnMessage"

    ~2

    Goto "start"

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    This should create two public variables NewRespawnMessage and RespawnMessage if the vehicle is respawned on the server.

    To show the message on all computers create a trigger (repeating) with the condition:

    NewRespawnMessage

    and the On Activation field:

    TitleText [RespawnMessage, "PLAIN"]; NewRespawnMessage = false; PublicVariable "NewRespawnMessage"

    This trigger should thus be activated on all machines once a vehicle is respawned, it displays the message and deactivates itself, thus being ready for a new message.

    This should work if you use the respawn multiple times (i.e. you need only one such trigger).

    ...and now I hope this stuff will work :-)

    Spinor


  5. KaRRiLLioN,

    try to put the Server condition just before the CreateVehicle command, like this

    ?(Local Server): _vcl = _class createVehicle getpos _respawnpoint

    The script should run on all machines (printing the text) but the vehicle is only spawned on the server.

    Of course you can optimize this by using the server condition also for the SetDir and the DeleteVehicle command.

    Regarding your vehicle type question, I also have this problem, but as far as I know there is no command that returns the class of an object but such a command like

    classstring = Class object

    would be very useful (hint to BIS wink.gif )

    Spinor


  6. I´m also sure that you can only create a unit in an existing group. As a workaround spawn the unit in a dummy group, then use [unitname] Join grpNull and the unit will be alone.

    To name the created unit try this as the Init-line parameter of createUnit: "unitname = this"

    Sadly, when used in a script, this crashes the game for me. Using it in a trigger works fine.

    Once named, it should be deletable with deleteVehicle

    Hope this helps,

    Spinor


  7. I think the reason why a radio trigger does not return a unit with thislist is simply that no unit can ever activate a radio trigger. A radio trigger can only be activated by a human player. This may seem pedantic but a human player and the unit he/she controls are not the same.

    hlq2action, you are right BIS could (or should) have made it possible, but I think it is not a bug of thislist.

    Spinor


  8. What are the names of user-placed markers in MP?

    In SP the markernames are given by "_USER_DEFINED #0/X", where X is a running number X=1,2,... according to the sequence they were placed.

    In MP this doesn´t seem to work. Has it something to do with changing the first number #Y/X ?

    It would be nice if one could process the positions of playerplaced-markers in scripts also in MP.

    Spinor


  9. Yeah, I read it and yeah, I think I understand your problem, but not please correct me if I'm wrong.

    The radio can only be activated by human players (so your problem is only relevant for MP, in SP there is trivially only one unit that can activate the radio, i.e. the player smile.gif ).

    I suggested the command player because it is a local command, i.e. it returns the unit that is controlled by the player on a specific machine.

    As my understanding goes it should work the following way:

    1) playerA clicks radio button

    2) the radiotrigger is only activated on the machine of playerA (not sure about that)

    3) any script called from the radiotrigger should run only on playerA-machine

    4) using the player command in such a script should return the unit controlled by playerA, and I think this is the information you want, e.g. GetPos player gives you the position of the calling unit

    Once again,

    hope this works,

    Spinor


  10. Regarding markers in MP, I have a rather special question:

    What are the markernames?

    In SP the markernames are given by "_USER_DEFINED #0/X", where X is a running number X=1,2,... according to the sequence they were placed.

    In MP this doesn´t seem to work. Has it something to do with changing the first number #Y/X ?

    It would be nice if one could process the poitions of playerplaced-markers in scripts also in MP.

    Spinor


  11. Hi,

    as far as I know the List command returns an array of units that are in the SCOPE of the trigger, i.e. that are within the trigger area and fulfill the trigger condition, e.g. all west units.

    If you group the trigger with a specific unit only this unit activates the trigger and List should only return this unit (if within area).

    You are right about the deactivation.

    To check if a unit is in the trigger scope (both area and condition) use the In command:

    unitname In (List triggername)

    This checks if unitname is contained in the array (List triggername) and returns true or false.

    Hope this helps,

    Spinor


  12. You can change the callsign with:

    <groupname> SetGroupID ["<callsign>","GroupcolorX"]

    where <groupname> is the name of the group, <callsign> can be:

    Alpha, Bravo, Charlie, Delta, Echo, Foxtrot, Golf, Hotel, Kilo, November, Yankee, Zulu, Buffalo, Convoy, Guardian, Two, Three

    and the X after Groupcolor can be 1, ..., 7:

    0: no color

    1: black

    2: red

    3: green

    4: blue

    5: yellow

    6: orange

    7: pink

    Example:

    (Group player) SetGroupID ["Foxtrot", "Groupcolor0"]

    Spinor

×