Completing a quest by rescuing units

BlargIAmDead

New Member
Reaction score
25
If I wanted to make a quest where you have to rescue four specific rescuable units in order to complete it, how would I do that?

For instance, I've tried this trigger, where Player 12 is composed of rescuable units, with no luck:

Preaching Wrapup
Events
Unit - A unit owned by Player 12 (Brown) Changes owner
Conditions
Village Square 0014 <gen> Equal to (Ownership-changed unit)
Village Square 0015 <gen> Equal to (Ownership-changed unit)
Village Square 0016 <gen> Equal to (Ownership-changed unit)
Village Square 0017 <gen> Equal to (Ownership-changed unit)
Actions
Quest - Mark PreachingHisName as Completed
Quest - Display to (All players) the Quest Completed message: COMPLETED: Preachin...
Quest - Flash the quest dialog button
 
G

Goauld

Guest
Those conditions can't be true all at once, Ownership-changed unit can't be four units in one event. Make condition Or and move those under it and then make an integer variable with 0 value. Then make your trigger set var = var + 1 and then make if then else which checks if var = 4 then make your actions else nothing.
 
M

MoonRazer

Guest
why dont u simple use the event

Code:
Untitled Trigger 002
    Events
        Unit - A unit owned by Player 1 (Red) Is rescued
    Conditions
    Actions

u would need to do it for each player but it should work.
 

BlargIAmDead

New Member
Reaction score
25
MoonRazer: It's a single player campaign, with the objective being to rescue four specific buildings from a computer player. Your trigger would activate whenever the human player rescued any of the computer's buildings at all.

Goauld: So the trigger/s should actually look like this?

Rescue Villages
Events
Unit - A unit owned by Player 12 (Brown) Changes owner
Conditions
Or - Any (Conditions) are true
Conditions
Village Square 0014 <gen> Equal to (Ownership-changed unit)
Village Square 0015 <gen> Equal to (Ownership-changed unit)
Village Square 0017 <gen> Equal to (Ownership-changed unit)
Village Square 0016 <gen> Equal to (Ownership-changed unit)
Actions
Set RescuedVillages = (RescuedVillages + 1)
If (RescuedVillages Equal to 4) then do (Trigger - Run Preaching Wrapup <gen> (checking conditions)) else do (Do nothing)

Preaching Wrapup
Events
Conditions
Actions
Quest - Mark PreachingHisName as Completed
Quest - Display to (All players) the Quest Completed message: COMPLETED: Preachin...
Quest - Flash the quest dialog button
 
G

Goauld

Guest
Hmm, if you only run the another trigger in the first trigger and put that condition in the second trigger's conditions. At least it'll make things easier to be modified. Then it should be right what it needs to be.
 

BlargIAmDead

New Member
Reaction score
25
I've tried the trigger as outlined above, and tried it again with "Run Preaching Wrapup (ignoring conditions)". Neither works. I'm not quite sure what Goauld meant; can anyone clear this up?
 
P

pattern

Guest
Actions
Set RescuedVillages = (RescuedVillages + 1)
If (RescuedVillages Equal to 4) then do (Trigger - Run Preaching Wrapup <gen> (checking conditions)) else do (Do nothing)


Should be:

Actions
If (RescuedVillages lower then 4) then do (Set RescuedVillages = (RescuedVillages + 1)) else do (Trigger - Run Preaching Wrapup <gen> (checking conditions))
 

BlargIAmDead

New Member
Reaction score
25
Do I need events or conditions for Preaching Wrapup then, or should it run automatically (completing the quest)? Because I've replaced the actions in Rescue Villages with the action pattern suggested, and Preaching Wrapup still won't run.
 
G

Goauld

Guest
Preaching Wrapup doesn't need events if you run it through another trigger. Put in it's conditions RescuedVillages Equal to 4 and make Rescue Villages only do action Trigger - Run Preaching Wrapup <gen> (checking conditions)

Did you make the rescuable units rescuable with the action Unit - make rescuable or do you just change the owner of the unit? Because they are different events, unit changes owner and unit is rescued.
 

BlargIAmDead

New Member
Reaction score
25
I went into "Player Properties" and made all of Player 12's units rescuable, including the four "Village Squares". But if I use "a unit owned by Player X is rescued" in Rescue Villages, there is no "unit X equal to rescued unit" in the conditions; there's only "unit X is equal to ownership-changed unit".

However, I'm just about to test the trigger again with the "unit X equal to triggering unit" condition instead. I'll let you know how it goes.
 
G

Goauld

Guest
I always use the triggering unit because others tend to reset in waits. Triggering unit always refers to the "A unit".

There is by the way a better solution to this, make Rescue Villages' events to be Village Square 0014 <gen> is rescued, Village Square 0015 <gen> is rescued and so on and you can take off the conditions.
 
G

Giho

Guest
MoonRazer: why dont u simple use the event

Code:

Untitled Trigger 002 Events Unit - A unit owned by Player 1 (Red) Is rescued Conditions Actions



u would need to do it for each player but it should work.

BlargIAmDead: It's a single player campaign, with the objective being to rescue four specific buildings from a computer player. Your trigger would activate whenever the human player rescued any of the computer's buildings at all.

Hmm, BlargIAmDead I doesnt fully agree with u. Cant u use Moonrazers proposal?

something like this?
Code:
Preaching Wrapup
    Events
        Unit - A unit owned by Player 12 (Brown) Is rescued
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Triggering unit) Equal to Village Square 0014 <gen>
                (Triggering unit) Equal to Village Square 0015 <gen>
                (Triggering unit) Equal to Village Square 0016 <gen>
                (Triggering unit) Equal to Village Square 0017 <gen>
    Actions
        Set RescuedVillages = (RescuedVillages + 1)
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                RescuedVillages Equal to 4
            Then - Actions
                Quest - Mark PreachingHisName as Completed
                Quest - Display to (All players) the Quest Completed message: COMPLETED: Preachin...
                Quest - Flash the quest dialog button
            Else - Actions
                Do nothing
 

BlargIAmDead

New Member
Reaction score
25
OK, I've got it now. The final trigger is almost exactly like Goauld and Giho suggested. Many thanks to them, and my apologies to MoonRazer for not reading closely enough.

This map is part of a (currently two-mission) single-player campaign. If any of you would like to test this campaign, please PM me.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top