• 🏆 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!

Talk for a quest

Status
Not open for further replies.
Level 2
Joined
Jul 6, 2018
Messages
13
Hello everyone, I am wondering how do you create an ability that starts a quest. For example:
Player 1 talks to the NPc with the quest ability, or so to say uses the (talk) button, which is the ability . The NPc starts a cinematic event, after the cinematic is done a quest is created for the triggering player. How do you do that :S I know it sounds a bit complicated, I will provide further information or better explanation if needed.
 
Level 13
Joined
Nov 4, 2006
Messages
1,239
You create a dummy ability, you could for example use faerie fire (or channel, or sth else, doesn't really matter as long as you set the allowed casting targets correctly) as a basis. you create a copy of that, set all effects to zero and the duration to 0.01, then choose you favorite icons for that and name it "Talk" or sth like that.

Then you create a trigger like this:

  • Events
    • Unit - a unit starts casting an ability
  • Conditions
    • Ability being casting equal to "Talk"
    • Target Unit of ability being cast is equal to "your NPC"
  • Actions
    • Trigger - Run Cinematic trigger
    • Trigger - Turn off this trigger
the last action is to prevent the trigger to work twice, since after the first time you already have the quest. i don't have enough time now to show you cinematic and quest triggers, but there are a lot of tutorials for that, so you should be able to figure that part out
 
Level 2
Joined
Jul 6, 2018
Messages
13
You create a dummy ability, you could for example use faerie fire (or channel, or sth else, doesn't really matter as long as you set the allowed casting targets correctly) as a basis. you create a copy of that, set all effects to zero and the duration to 0.01, then choose you favorite icons for that and name it "Talk" or sth like that.

Then you create a trigger like this:

  • Events
    • Unit - a unit starts casting an ability
  • Conditions
    • Ability being casting equal to "Talk"
    • Target Unit of ability being cast is equal to "your NPC"
  • Actions
    • Trigger - Run Cinematic trigger
    • Trigger - Turn off this trigger
the last action is to prevent the trigger to work twice, since after the first time you already have the quest. i don't have enough time now to show you cinematic and quest triggers, but there are a lot of tutorials for that, so you should be able to figure that part out

Yeah but that would start the trigger quests for all players, and I want the quest to be created for only the specific player who caused the ability casting.

What I tried is:

Unit starts the effect of an ability
ability being cast equal to (talk)
Triggering player equal to (player 1 etc...)
Actions...

Different trigger for different player, but that didn't work though. the trigger just wont go on after the ability being cast equal to my ability.
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,030
There is no triggering player because the event is a unit event, not a player event. Use Owner of (Triggering Unit) instead. You can make a global boolean array variable to store whether a player has started that particular quest yet, then check that variable in the trigger conditions so you only need 1 trigger per quest.

Make sure you set the default size of your array to be 24. It should default to false.

  • Conditions
    • Ability being cast equal to Talk
    • Quest_1_Started[(Player number of (Owner of (Triggering Unit)))] equal to false
  • Actions
    • Set TempPlayer = (Owner of (Triggering Unit))
    • Set Quest_1_Started[Player number of TempPlayer] = true
    • Quest - ...
 
Status
Not open for further replies.
Top