• 0.956982131039047

    posted a message on Trigger error

    Picked units must be defined first.
    You should use any unit(or if you have only one hero that is placed on them, use it az a fix value) in the events
    or as you did earlier define it in the condition instead of the event but not as 'picked unit', but 'triggering unit'.
    the action you did shouldwork if you change the event and the conditions from 'picked unit' to 'triggering unit'

    So if you have one hero that you already placed in the map. You can reference him directly.

    Events
           Unit -Cargo Truck (Trailer) [127.83, 146.06] dies
    Local Variables
    Conditions
    Actions
           Game -End game in Defeat for player (Owner of (Triggering unit)) (Show dialogs, Show score screen)

    you can use fix player instead of owner of triggering unit if you woud like. but usually the hero owner loses the match, so that'why I created the code this way :). Also with this you can copy the trigger for another unit with another owner player, you just reselect the other hero en the other event, and you can copy the action from the previously created one without modify the player manualy :).

    Posted in: Triggers
  • 1.30857459978767

    posted a message on Make AI Replace Created Units?

    In reply to dudkisc2:

     do you want to rebuild, replace or revive them?

    for rebuild(AI rebuilds the specified unit types) there are 2 rebuild triggers. one is working with object class (unit, building) and one with unit types. it requires active AI I think.

    for replace (change a unit to other unit defined by unit types also stats can be moved too)there is a trigger that changes a specified unit(last created, picked unit, triggering unit, value, variable, etc.) with another unit of the given unit type. for exmaple changes a placed marine to marauder. or can change all marine in a unit group to marauders. for tha last example you must put the marines in to unit group.

    for revive, (revive the unit that died)there is a trigger that revives a specified unit. Important that the trigger only work by itself if the a revive is instant after the unit dies, and uses the dying position as revive point. If you want some time before it happens, you must put the dying unit into a variable, and later ony use this variable in the unit part. Also there is 2 hero revive function but I didn't tested it yet. In star craft 2 the revive works with any units, not just with heroes, as in warcraft 3 where only heroes can be revived, or at least it was like this before reforged.

    Posted in: Triggers
  • To post a comment, please or register a new account.