Jump to content

Spinor

Member
  • Content Count

    208
  • Joined

  • Last visited

  • Medals

Posts posted by Spinor


  1. The userplaced markers are called "_USER_DEFINED #0/N" where N is 0,1,2,...

    E.g. the first marker is called "_USER_DEFINED #0/0",

    the second one "_USER_DEFINED #0/1" and so on.

    To extract the position simply use

    _pos = GetMarkerPos "_USER_DEFINED #0/N"

    You can also extract the type by

    _type = GetMarkerType "_USER_DEFINED #0/N"

    This can be useful because the player can determine the type when placing a marker with cursor up/down.

    There are two difficulties using this method:

    -Markers placed by the mission designer in the editor are counted in the N, e.g. if there are 5 fixed markers from the designer, the first marker placed by the player is called "_USER_DEFINED #0/5"

    -Somehow the counting gets out of tune when the player deletes one of his markers. To prevent this you should move the usermarker off the map to avoid this.

    This all was discovered by Snypir and he has a good tutorial on it at www.ofpeditingcenter.com.

    I use the following script to prevent most difficulties, it scans for user markers and when one is placed it calls some script (here "markeraction.sqs") with the position and the type of the marker as arguments.

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

    ;continously scans for usermarkers and calls "markeraction.sqs" with the position and the type of the newly placed marker

    ;[<already placed>, marker mode] exec "markerscan.sqs"

    ;[5, "ON"] exec "markerscan.sqs"

    ;<already placed> is the number of markers prior to the call

    ;marker mode can be (while running change this via the global variable rMarkerMode)

    ;"ON" -- > move off map + call "markeraction.sqs"

    ;"OFF" --> do nothing, but still count the placed markers

    ;"HIDE" --> move off map, no action

    ;"EXIT" --> exit markerscan script

    rMarkerMode = _this select 1

    _i = _this select 0

    #Scan

    ?rMarkerMode == "EXIT": Exit

    _marker = Format ["_USER_DEFINED #0/%1", _i]

    _pos = GetMarkerPos _marker

    ?_pos select 0 != 0: _i = _i + 1; Goto "Placed"

    Goto "Scan"

    #Placed

    ?rMarkerMode == "OFF": Goto "Scan"

    ?rMarkerMode == "HIDE": _marker SetMarkerPos [-10, -10, 0]; _marker SetMarkerType "Empty"; Goto "Scan"

    ?rMarkerMode == "ON": _marker SetMarkerPos [-10, -10, 0]; [_pos, GetMarkerType _marker] exec "markeraction.sqs"; _marker SetMarkerType "Empty"

    Goto "Scan"

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

    Hope this helps,

    Spinor


  2. As the editor now has a auto-completion feature, I came across some commands:

    setTerrainGrid

    buttonAction

    queryAmmunitionPool (or something like that),

    but I have no idea how to use them. Sadly, the Resistance readme doesn´t explain them. I hope there will be an update of the official command reference soon.


  3. As the editor now has a auto-completion feature, I came across some commands:

    setTerrainGrid

    buttonAction

    queryAmmunitionPool (or something like that),

    but I have no idea how to use them. Sadly, the Resistance readme doesn´t explain them. I hope there will be an update of the official command reference soon.


  4. As the editor now has a auto-completion feature, I came across some commands:

    setTerrainGrid

    buttonAction

    queryAmmunitionPool (or something like that),

    but I have no idea how to use them. Sadly, the Resistance readme doesn´t explain them. I hope there will be an update of the official command reference soon.


  5. As the editor now has a auto-completion feature, I came across some commands:

    setTerrainGrid

    buttonAction

    queryAmmunitionPool (or something like that),

    but I have no idea how to use them. Sadly, the Resistance readme doesn´t explain them. I hope there will be an update of the official command reference soon.


  6. What other scripts? The scripts listed above are in the scripts.pbo (I think in the "dta" folder of OFP). If you dePBO this you have access to the scripts. Simply put them in your respective missions folder and edit them in any way you want.

    The problem of these scripts is that they are only executed when a human player is killed. This means you can't use them when an AI unit is killed.


  7. You are almost right. The scripts

    onPlayerKilled.sqs

    onPlayerRespawnAsSeagull.sqs

    onPlayerRespawnOtherUnit.sqs

    in the scripts.pbo are AUTOMATICALLY called when the appropriate event happens, e.g. in SP when the player is killed the script "onPlayerKilled.sqs" is executed. Additionally, these scripts are called with the killed player and the killer as arguments (again, automatically).

    To create your own camera sequence, simply put the respective script in your missions folder (scripts will be searched first in missions folder, then in the campaign folder and finally in the scripts.pbo) and edit it however you want. To get info about the killed and the killer use:

    _player = _this select 0

    _killer = _this select 1

    The only thing you must keep in the script is the line

    enableEndDialog

    otherwise there will be no end dialog for the player to exit the mission.

    Hope this helps,

    Spinor


  8. You could also use the following condition:

      "Alive _x" Count (Units group) == 0

    I have found that using the Count command in such a way can be very useful, e.g. if you want to trigger an action when one of the groups units is unable to walk and not in a vehicle, (thus bogging the whole group down) you can use

      "!(CanStand _x) AND ((Vehicle _x) == _x)" Count (Units group) > 0

    Spinor


  9. </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">No. this allows you to select groups and give them move orders by using your map.<span id='postcolor'>

    Are you refering to SelectThis command script or my Command Engine?

    In my Command Engine I use a generic radio menu script that does exactly what you want, i.e. selecting a radiobutton will open a new list of options (in principle infinitely). I think at the OFPEC there is also another script that does that.

    To simply print new text in the radio menu, use the SetRadioMsg command:

    ID SetRadioMsg "text"

    where ID is a number from 1 to 8 corresponding to the eight radiochannels Alpha, Bravo, ....

    Thus displaying a new set of options is quite easy, the tricky thing is to have the proper action for each radio button performed depending in which menu you are currently in.


  10. I think AddAction works only with scripts, so your example shouldn´t work.

    But you can simply write your eject command in a script and call this script with AddAction

    aP addaction["ACTIONNAME","eject.sqs"]

    ;eject.sqs;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

    ;I think action ["EJECT", ...] needs also the Vehicle to eject

    ;from as parameter, not sure though

    aP action ["EJECT", Vehicle aP]

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


  11. The SetSpeedMode command only affects the group as a whole, it probably doesn't affect the DoMove and CommandMove commands which are used for single units. Use the Move command instead.

    If you want to move the whole group in Limited and Safe mode, try the following:

    (Group aP) SetBehaviour "SAFE"

    (Group aP) SetSpeedMode "LIMITED"

    (Group aP) Move [x,y]

    Hope this helps,

    Spinor


  12. About the AddAction command:

    When the AddAction script is executed, it is automatically called with the ActionID, the unit you added the action to and the unit that performs the action as arguments, e.g. if you used

    anActionID = vehicle1 AddAction ["Destroy vehicle", "destroy.sqs"]

    and the player perfoms the action, the script "destroy.sqs" is called like

    [anActionID, vehicle1, player] exec "destroy.sqs"

    and the arguments can thus be used within the script.

    For your problem, I would use one filter script for the action that determines the calling unit, i.e. add one script to all units:

    "_x AddAction [""DoSomething.sqs"", ""DetermineUnit.sqs""]" ForEach thislist

    and use "DetermineUnit.sqs" to call the different players scripts:

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

    _callingUnit = _this select 2

    ?_callingUnit == someGuy: [] exec "SomeScript.sqs"

    ?_callingUnit == anotherGuy: [] exec "AnotherScript.sqs"

    .........

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

    Hope this helps,

    Spinor


  13. Simply by moving it to its original position tounge.gif

    Of course, you have to store the original position somewhere, like

    origPos = GetMarkerPos "marker1"

    "marker1" SetMarkerPos [-1000,-1000,0]

    ....

    ....

    "marker1" SetMarkerPos origPos

    I think using SetMarkerSize is easier. Lets say you want the area marker to be initially hidden. Create the marker you need in the editor and choose both size values = 0.

    To make it appear during the game, simply use

    "marker1" SetMarkerSize [200,300]

    which would give you a 200*300 meter ellipse or rectangle.


  14. Yes, you are right, the CreateUnit command is more difficult to use than CreateVehicle because it does not return the unitname like:

    _tankname = "M1Abrams" createVehicle (getmarkerpos "tankFactory")

    The easy way to circumvent this is simply to not refer to the spawned man at all, but to the group it is spawned in. You have to create the unit anyway in an existing group:

    "SoldierWB" createUnit [getMarkerPos "barracks", groupAlpha]

    If you want to move the unit, move the group  biggrin.gif

    But if you really need to control the specific unit you can actually identify the created unit by using an init string within the createUnit argument. If you use

    "SoldierWB" createUnit [getMarkerPos "barracks", groupAlpha, "CreatedSoldierWB = this"],

    you should be able to refer to the unit with CreatedSoldierWB as name, e.g. you can have him make a chat like

    CreatedSoldierWB sideChat "I think, therefore I am."

    The only annoying thing is that you have to create the unit in an existing group, but even this can be avoided by making the newly created unit to join GrpNull, thus creating a new group. In a trully dynamic RTS style mission you then only have to take care of to not violate the 63 group limit.


  15. Yeah, you are right, it seems that you can´t hide the area markers (or generally speaking, use the SetMarkerType command to change the marker).

    What you can still do is to move the marker off the map, e.g.

    "marker1" SetMarkerPos [-1000,-1000,0]

    or if you want to keep the marker position, you can also resize the marker to zero size:

    "marker1" SetMarkerSize [0,0]


  16. The Count command could be useful for this, I would do it the following way:

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,,

    _group = _this select 0

    ;this determines the initial number of units when calling

    ;the script

    _initialNumber = Count (Units _group)

    #Loop

      _units = Units _group

      ;counting all alive units

      _alive = "Alive _x" Count _units

      ;calculating casualties since initialization

      _casualties = _initialNumber - _alive

      ;counting all alive units with damage > 0.5

      _wounded = "(Alive _x) AND ((GetDammage _x) > 0.5)" Count _units

      Hint Format ["Casualties: %1\nWounded: %2", _casualties, _wounded]

      ~30

    Goto "Loop"

    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;,;;;

    Call this script with group as argument like

      [testgroup] exec "CasualtyCount.sqs".

    It should hint the number of casualties since calling the script and the number of wounded (Damage > 0.5) every 30 seconds.

    Instead of checking the damage, you could also check for

      !(CanStand _x)

    which returns true when the unit is unable to walk.

    Hope this helps,

    Spinor


  17. </span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">So, any new estimates on how long before we get to play with the beta? smile.gif<span id='postcolor'>

    ............I knew he'd say that biggrin.gif

    As I said, I will probably finish the Command Engine in about 1-2 month and will release it as a standalone.

    This will already give you the opportunity to command other squads, thus play the general. I'm trying hard to make it as MP-compatible as possible, so hopefully you can already match it out with someone else.

    For Conquest, the biggest chunk that is missing is the enemy AI which is only in a very preliminary state and I really can't make any serious estimate when it will be finished.


  18. Hi,

    I am a member of the Conquest team, doing mostly scripts. I am sorry for the lack of updates lately. Rest assured that we are still working on Conquest, but you must see that we are doing nothing short of creating another game within OFP and our goals are high.

    The reason for the lack of updates is simply that our problems are very technical in nature, e.g. we are creating no new models we can post screenshots of.

    For example, I have been working for some time on a script that makes a group follow waypoints. Now you ask: Whats that good for? OFP already has that. Thats true, but in Conquest we need totally dynamic, deletable, movable, editable waypoints, whereas in OFP the waypoints are rather fixed once the mission starts.

    Many other problems we have to deal with are of that sort and I hope you understand we can't much about it in public.

    Hopefully, I can soon (1-2 month) finish my Command Engine 2 (for the first version take a look at the Code snippets section of www.ofpeditingcenter.com). This will handle all the Command & Control of the groups by the player.

    Please be patient,

    Spinor

×