• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Quests

Status
Not open for further replies.
Level 14
Joined
Apr 21, 2007
Messages
1,465
I am not sure what you mean by this post. If I understand correctly you are not sure how to make quests. Use the action - Create Quest. Then choose if you want it to be an optional or required and then type in a name and description(the objective of the quest) and select the icon you want your quest to have in the quest log. You can update your quest via the Mark quest as complete/failed/discovered or by changing the title or description of it(so that you can add the second objective of the quest or whatever).


Hope this helps!

EDIT: Darn GhostWolf, you beat me by a couple of seconds :(
 
Level 7
Joined
Oct 8, 2007
Messages
154
ok creating variable is not problem for me ;] but thanksfor good tip because i want to have hundreads of quests. U guys dont know what I exactly want. U are allright i described it bad because my friend who makes terrain told me that is my turn in mapmaking :] (im making units spells scripts ald everything besides terrain)

Now Quests System that i want for my map.

I want to have such quests as in for example blizzard melee campagin or in many orpgs. I want quests like that:

There is unit/hero/buildnig/ staying with "!" or question mark upon its head. But region would also make me satisfied, wanna to show quest msg only to player who took the quests (if its not possible i will use team).

Example:
Event
Hero from team 1 appears unit with mark upon its head.
condition: team 2 cannot take that quest

actions: show quest message to player for example:
"Aghh those nasty peons raped my wife I want u to revange"
example Quest msg: Kill 12 peons.
add quest to log
^ thats all what i can do :D
but how to make quest completed when hero will kill 12 peons? And gain extra exp ? (I know how to add gold or items)

But how to do it only when player will complete the objectives?

And now harder example. Tooken from my funny ORPG that im working on.

Event:
Hero appears marked unit (eventually enters region)
Condition:
Team 1=true, team 2=false.
If all conditions are true than do actions:
Actions:
Show quest msg:
Satanists wants to kill and eat my cat, but they appears (spawns) on the hill only on 0:00 hour (game time) U must kill the satanists and rescue my cat. I want you to bring it here.
Add Quest to log with such description
of course
Create 3 "Satanist" on 0:00 gametime hour (that can work without that quest as else trigger) in region "hill"
Mark quest as completed when: 3 satanists are killed, rescueable "cat" is rescued and moved to region.
And when Quest is completed show msg kinda : "O thank u my salvation here u got 300gold"
Properties- add 300 gold when quest is completed.
Mark quest as failed when:
Specific Unit "Cat" is dies. When quest is failed show msg: "U are not worth my trust u wont get anymore quests in this area goodbye"

How to create it? My biggest problem are objectives, completing and failing them,all other things i can handle by myself

Thanks in advice
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
As I said, you need to code it all.

For the special effect shown only to a single player, you will need to use a Floating Text.
Special effects can't be shown to single players (unless... hmm... I think GetLocalPlayer() will sync, anyone knows ? i'm too lazy to test).


Now for your quest example, you create a trigger that checks when a peon killed and raise a integer's value.
When that value is 12 you finish the quest and give rewards/whatever.

Now when someone gets the quest, activate the trigger and you are done.


Changing texts is quests are done manually by the quest actions.
 
Level 7
Joined
Oct 8, 2007
Messages
154
ok i will check it a number of peons shall be variable?

editing post...

Ok that works but only for 1 specific "Kid of Corn" i want it to raise integer value when any kid of corn is killed not this specific one

  • Events
    • Unit - A unit enters benek234 quest <gen>
  • Conditions
    • ((Entering unit) belongs to an ally of Player 1 (red)) equals YES
  • Actions
    • If ((Kid of Corn 0169 <gen> is dead) equals YES) then do (Quest - Display to Player's Group - Player 1 (Red) the Quest Completed message: Quest Completed now...) else do (Text - Create floating text that reads Go back and kill'em... above benek234 0067 <gen> with Z offset 0.00, using font size 8.00, color (100.00%, 50.00%, 50.00%), and 0.00% transparency)
    • Text - Create floating text that reads Hey you come here g... at (Center of benek234 quest <gen>) with Z offset 0.00, using font size 16.00, color (100.00%, 0.00%, 100.00%), and 0.00% transparency
    • Quest - Display to Player's group - Player 1 (Red) the Quest discovered message: Quest Discoverd: K...
    • Quest - Create a sub quest titled Nasty Corn Thieves ... with the description Objectives -Kill 1..., using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
    • Quest - Create a quest requirement for (Last created quest) with the description 12 Kids of corn kil...
ask about words if i missed sth in translation ^ (im translating trigger becaues my WE is in polish language)
 
Last edited:
Level 19
Joined
Sep 4, 2007
Messages
2,826
GhostWolf, here I go again. :grin: Though I know this isn't excacly what he wants...
Here is a small example how how variables work.
Event
A guy eats taco.
Condition
Action
If, then, else Condition
If
Value of taco_left = 1 or more.
Then - Actions
Eat more tacos.
Set taco_left = taco_left - 1
Else - Actions
Buy more tacos.
Set taco_left = taco_left + 5

taco_left is an Integer variable which in this case tells how much taco(s) are left.


If you need any more help these instruction should lead you in the right direction.
Though the first trigger which gives, finishes quests and allow you to interact with the NPC is functional for multiplayer as well as singleplayer.
Don't get scared of all these triggers. Some of them are just to create some interactive between the NCP and the player.
To get this [(Player number of (Owner of (Killing unit)))] you need to set arrays(the amount of players) to the variables which are used in these triggers.
Count_Killed_Units is an integer variable with arrays.(the amount of players)
Quest_Pig_Hunt is also an integer variable with arrays.(the amount of players)
  • ReciveQuest
    • Events
      • Unit - A unit comes within 256.00 of Farmer'sQ
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] Equal to 0
        • Then - Actions
          • Quest - Display to (All players) the Quest Update message: (Hi, my farm is getting overrunned by some pigs. Could you help me get rid of them + ((Name of (Owner of (Entering unit))) + ?))
          • Set (Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] = (Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] Equal to 1
        • Then - Actions
          • Quest - Display to (All players) the Quest Update message: (Hi, have you killed those horrible pigs yet + ((Name of (Owner of (Entering unit))) + ?))
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] Equal to 2
        • Then - Actions
          • Quest - Display to (All players) the Quest Update message: (((Thanks + (Name of (Owner of (Entering unit)))) + for getting ridd of those pigs for me. Here take this item.) + <Empty String>)
          • Set Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] = (Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] + 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] Equal to 3
        • Then - Actions
          • Quest - Display to (All players) the Quest Update message: Hi, there.
        • Else - Actions
AS you've seen, there are 4 stages in this trigger.
1: The entering player gets the quest by giving his variable (Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] the value 1.
2: When the player returns with the (Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] still with the value 1 the player gets to know that the quest isn't done yet.
3: When the player returns from finishing the quest he gets an item
4: Every time the player walks around the quest giver he says "Hi, there!"
First you need a trigger that counts how many quest units you've killed which will for fill the first trigger. It Should look simulare to this:

  • CountKilledUnit - Works in multiplayer
    • Events
      • Unit - A unit Dies
    • Conditions
      • And - All (Conditions) are true
        • Conditions
          • Quest_Pig_Hunt[(Player number of (Owner of (Killing unit)))] Equal to 1
          • (Unit-type of (Dying unit)) Equal to Pig
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Count_Killed_Units[(Player number of (Owner of (Killing unit)))] Less than 10
        • Then - Actions
          • Set Count_Killed_Units[(Player number of (Owner of (Killing unit)))] = (Count_Killed_Units[(Player number of (Owner of (Killing unit)))] + 1)
          • Game - Display to (All players) the text: (((Name of (Owner of (Killing unit))) + has killed ) + (String(Count_Killed_Units[(Player number of (Owner of (Killing unit)))])))
        • Else - Actions
          • Quest - Display to (All players) the Quest Update message: (((Name of (Owner of (Killing unit))) + has completed the quest and killed ) + (String(Count_Killed_Units[(Player number of (Owner of (Killing unit)))])))
          • Set (Quest_Pig_Hunt[(Player number of (Owner of (Killing Unit)))] = (Quest_Pig_Hunt[(Player number of (Owner of (Killing Unit)))] + 1)
This trigger gives the makes it possible for the player to complete the quest by setting (Quest_Pig_Hunt[(Player number of (Owner of (Killing Unit)))] to value 2 which tells the first trigger that you've completed the quest.
Enjoy.
 
Last edited:
Level 19
Joined
Sep 4, 2007
Messages
2,826
I also posted this in another thread lol...
Edit: I'm using this image for another site becaue I'm too lazy.
 

Attachments

  • Unavngivet.jpg
    Unavngivet.jpg
    18.1 KB · Views: 141
Last edited:
Level 19
Joined
Sep 4, 2007
Messages
2,826
Further information.
thank you for taking the time to go into so much detail redmarine. I will try this out later on it makes sense, i only have trouble sometimes finding the actually identical trigger :) Also one last question, if i set a quest to a integer when the quest is complete eg kill a boss, the boss death trigger sets the integer for the quest to 1 for example and this triggers the quest complete action. Storing quests as variable will allow me to set a quest and come back to it later on whilst others have been made and completed is this how it all works?

Yep, I'll explain it: When a unit enters the quest giver's region, if the owner of entering unit got the value of his/her Quest_Pig_Hunt = 0 the entering player gets the quest when the value changes to 1.
It works for multiplayer because an array works like this.
You can make Quest_Pig_Hunt an array for all players. In this case you should set the Quest_Pig_Hunt array to (amount of players)
Quest_Pig_Hunt Array 1 = red
Quest_Pig_Hunt Array 2 = blue
Quest_Pig_Hunt Array 3 = teal
Quest_Pig_Hunt Array 4 = purple
Quest_Pig_Hunt Array 5 = yellow
and so on...
Which means if the entering unit is player 1, then Set Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] = (Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] + 1) sets the red's Quest_Pig_Hunt to value 1.
And if it is player 2 or player 3, the value will be 1 just like player 1 because the only thing that changes is the array.
Set Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] = (Quest_Pig_Hunt[(Player number of (Owner of (Entering unit)))] + 1)
The yellow text is the variable and the green text is the array(s).
---------------------------------------------------------------------------
Event
A guy eats taco.
Condition
Action
If, then, else Condition
If
Value of taco_left = 1 or more.
Then - Actions
Eat more tacos.
Set taco_left = taco_left - 1
Else - Actions
Buy more tacos.
Set taco_left = taco_left + 5
If we don't use arrays here the variable would just have 1 value. Example if player 1 eats taco(s) then player 2 will also be able to eat taco(s) from the same taco box.(taco_left = a taco box in this case with a lot of tacos lol...) If we add array to 2 then there will be 2 taco boxes and they'll have a box each.
To fix this trigger:
Event
A guy eats taco.
Condition
Action
If, then, else Condition
If
Value of taco_left[(Player number of (Owner of (Eating Unit)))] = 1 or more.
Then - Actions
Eat more tacos.
Set taco_left[(Player number of (Owner of (Eating Unit)))] = taco_left[(Player number of (Owner of (Eating Unit)))] - 1
Else - Actions
Buy more tacos.
Set taco_left[(Player number of (Owner of (Eating Unit)))] = taco_left[(Player number of (Owner of (Eating Unit)))] + 5
Btw Eating Unit doesn't exist. ;)
---------------------------------------------------------------------------
From my experiences a lot of examples gives a lot better understanding, because sometimes people don't understand right away. If you need anymore help just ask. Btw instead of using "Quest - Display to (All players) the Quest Update message:" you can use "Game - Display to (All players) the text:" but I would prefer "Quest - Display to (All players) the Quest Update message:" because it is different and it also tells you that you are doing quests.
To be honest I haven't tested the triggers but they should work.





But if you just wanted to know how to reset the quest then just set the value of the quest and the kill variable to 0
 
Status
Not open for further replies.
Top