quests

Ormagon

New Member
Reaction score
1
Ok i am still new to the whole mapping thing and i would like to add a few quests to my first rpg that will activate wen the quest giver is selected but ONLY of a unit is in an area around the questgiver that is owned by the player.
us there a tutorial for this?? all the ones i have found are unit enteres area and gets quests or the quest is linked to a cinematic
 

Exide

I am amazingly focused right now!
Reaction score
448
There's a condition (Boolean, I believe) that checks 'If *Region* contains *Unit*) Equal to True/False. -That should help you.
 

Exide

I am amazingly focused right now!
Reaction score
448
Here's how I made a side-quest:

Code:
Sneaky Quest
    Events
        Unit - A unit comes within 150.00 of Sneaky-Looking Man 0043 <gen>
    Conditions
        ((Triggering unit) is A Hero) Equal to True
        Night Equal to False
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Triggering unit) has an item of type Goldstatue) Equal to True
            Then - Actions
                Unit - Remove TalkToMeUnit[2] from the game
                Quest - Destroy Assignment[3]
                Item - Remove (Item carried by (Triggering unit) of type Goldstatue)
                Quest - Display to (All players) the Quest Update message: |c000080C0-You've f...
                Set loc = (Position of (Triggering unit))
                Special Effect - Create a special effect at loc using UI\Feedback\GoldCredit\GoldCredit.mdl
                Set SpecialFX = (Last created special effect)
                Trigger - Run Special Effect Destruction <gen> (ignoring conditions)
                Player - Add 200 to Player 1 (Red) Current gold
                Trigger - Turn off (This trigger)
                Wait 25.00 seconds
                Unit - Remove Sneaky-Looking Man 0043 <gen> from the game
                Skip remaining actions
            Else - Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ContactMeet Less than or equal to 1
                (Execution count of (This trigger)) Equal to 1
            Then - Actions
                Quest - Display to (All players) the Quest Update message: |c000080C0-Hey, you...
                Quest - Create a Optional quest titled (Colors[6] + The Statue|r) with the description |c000080C0A Sneaky-..., using icon path ReplaceableTextures\CommandButtons\BTNTransmute.blp
                Set Assignment[3] = (Last created quest)
            Else - Actions

There's nothing special about this trigger. What it does is to check if the unit that comes near the "quest unit" has the Quest item (Goldstatue). If he doesn't, this trigger checks if this is the first time the trigger runs. If it is: the player will be given the quest, if the trigger has run more than one time, nothing will happen unless the hero has the Quest item.
Is that what you need? :p
 

Ormagon

New Member
Reaction score
1
not rly i need a link to tutorial thats will explain to me every aspect of quest making but thanks to you i understand the basics still need tutoeial thought
 

Exide

I am amazingly focused right now!
Reaction score
448
Ok, so let's take it from the start. :p
I assume that you have already placed your region and quest giving unit.

Code:
Untitled Trigger 001
    Events
        Player - Player 1 (Red) Selects a unit
    Conditions
        (Unit-type of (Triggering unit)) Equal to Footman
    Actions

This should be pretty self-explaining. -What happens is Player 1 selects a unit. If the unit is equal to Footman then .. -Run actions-. (In this case you will change Footman to your Quest giving unit.)
If your map has several players, this will be a lot harder. -First thing you need to do is to add several events, like this:

Code:
Untitled Trigger 001
    Events
        Player - Player 1 (Red) Selects a unit
        Player - Player 2 (Blue) Selects a unit
        Player - Player 3 (Teal) Selects a unit
        ..And so on..
    Conditions
        (Unit-type of (Triggering unit)) Equal to Footman
    Actions

Since these are events, the trigger will fire if any of the event is true. Conditions, however, answer to and. -If there are several conditions, they must all be true for the trigger to run. (Unless you specify it to be Or.)

Now, you will need to check if the unit itself is in your pre-placed region:

Code:
((Playable map area) contains (Triggering Unit)) Equal to True

-For this to work, you will have to set your Hero-unit to a variable. Preferably calling it 'Hero' or something similar.

Code:
Untitled Trigger 001
    Events
        Player - Player 1 (Red) Selects a unit
    Conditions
        ((Playable map area) contains (Triggering Unit)) Equal to True
        (Unit-type of (Triggering unit)) Equal to Footman
    Actions

As I mentioned before, conditions are and. Now that you've got two conditions, they must both be true, in order for the trigger to continue.

As of now, your trigger is no good, you will need to specify the conditions:

Code:
Untitled Trigger 001
    Events
        Player - Player 1 (Red) Selects a unit
    Conditions
        (([B]*Your_Pre-Placed_Region'[/B]) contains [B]*Your_Hero_Unit*[/B]) Equal to True  //This checks if your Hero is in your Quest Region 
        (Unit-type of (Triggering unit)) Equal to [B]*Your_Quest_Unit*[/B]   //This checks what type of unit is being selected.
    Actions

Side-Note:
Code:
((Playable map area) contains (Triggering Unit)) Equal to True
This condition can be found under Boolean Comparison. -You can tell, because it ends with an 'Equal to True'. (Which can, of course, be changed.)

Ok, now you've got your trigger set up, now all you need are some actions. -These are considered (by me :p) the easy part. So let's get on with it already!

To start, we will just create a small Quest Message, as if the units were interacting with eachother, and add the Quest to the Quest Menu:

Code:
    Actions
       Quest - Display to (Player group((Triggering player))) the Quest Update message: Help! Bandits are i...
       Quest - Create a Optional quest titled Bandits! with the description Slay the Bandits an..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp

There we go, now to the explanation:
*The first action will show the message (ONLY to the Player that has selected the unit - you can change this if you wish.), saying something about Bandits.
*The second action will create the quest in the Quest Menu. -In case the players forget and want to re-read it. You can choose if you want the quest to be optional or required (what side of the Quest Menu it is supposed to show up on), also you can choose the icon for the Quest, in the Quest Menu. It's set to Ambush - by default. (You can also change this, if you like.)

This gives us:

Code:
Untitled Trigger 001
    Events
        Player - Player 1 (Red) Selects a unit
    Conditions
        (([B]*Your_Pre-Placed_Region'[/B]) contains [B]*Your_Hero_Unit*[/B]) Equal to True   
        (Unit-type of (Triggering unit)) Equal to [B]*Your_Quest_Unit*[/B]   
    Actions
        Quest - Display to (Player group((Triggering player))) the Quest Update message: Help! Bandits are i...
        Quest - Create a Optional quest titled Bandits! with the description Slay the Bandits an..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp

In order to make this trigger work even better, you might want to remove the spam that can be caused by the Players, if the keep clicking this unit. (Since the trigger will run everytime they click it.)

For this, we need a new condition. You can add it to the "main conditions" or in a another function, called 'If / Then / Else'. Since it's a simple function, we'll use the "main conditions":

Code:
(Execution count of (This trigger)) Equal to 0

This means if the trigger hasn't run yet, it will finish running, then it won't run anymore. -So the players can only click the unit and recieve the quest ONCE.
However. If you have multiple players that shall recieve a quest each, this won't work, and you will need to use variables instead.

So, the outcome of your trigger should be:

Code:
Untitled Trigger 001
    Events
        Player - Player 1 (Red) Selects a unit
    Conditions
        (Execution count of (This trigger)) Equal to 0
        (([B]*Your_Pre-Placed_Region'[/B]) contains [B]*Your_Hero_Unit*[/B]) Equal to True   
        (Unit-type of (Triggering unit)) Equal to [B]*Your_Quest_Unit*[/B]   
    Actions
        Quest - Display to (Player group((Triggering player))) the Quest Update message: Help! Bandits are i...
        Quest - Create a Optional quest titled Bandits! with the description Slay the Bandits an..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp

You will then need a trigger for completing the mission and for the reward. -Depending on your mission.
A simple mission might be to retrieve an object, and return it to the Quest Giver. ("Go slay the Bandits, steal their loot and return it to me!")

To start, you will need a trigger that checks if the unit is nearby, or entering the region. You can also choose the setup for the first trigger you made. It's up to you.
Then you need to add one condition that checks if the unit has the item:

Code:
Untitled Trigger 002
    Events
        Unit - A unit enters Your_Region
    Conditions
        ((Triggering unit) is A Hero) Equal to True
        ((Triggering unit) has an item of type [B]*Quest_Item*[/B]) Equal to True
    Actions

Then add your actions, perhaps something like this:

Code:
Untitled Trigger 002
    Events
        Unit - A unit enters Your_Region
    Conditions
        ((Triggering unit) is A Hero) Equal to True
        ((Triggering unit) has an item of type [B]*Quest_Item*[/B]) Equal to True
    Actions
Actions
        Quest - Display to (All players) the Quest Update message: You found it! Give ...
        Item - Remove (Item carried by (Triggering unit) of type [B]*Quest_Item*[/B])
        Player - Add 1000 to (Owner of (Triggering unit)) Current gold
        Quest - Destroy (Last created quest)

This will remove the Quest Item, give 1000 gold to the player who completed the quest, and remove the quest from the Quest Menu. -However. (Last created quest) might not work, it's safer to use variables for this.

That's about it. :p
*Whew*
 

Ormagon

New Member
Reaction score
1
its so clear now TY!

but in stead of last created quest if i add a specific quest??
or is that not possible??
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top