• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Quest problem

Status
Not open for further replies.
Level 7
Joined
Apr 7, 2009
Messages
241
In my ORPG I use this method to enable players to pick up quests:
  • Events
    • Unit - A unit comes within 100.00 of Sergeant Jeffrey 0094 <gen>
I dont like it very much and it creates problems with chain quests too. The moment you come in range of the unit with a finished quest then you instantly get the follow-up chain quest wether you want it or not. I want to make it so that you have to first go out of range and then go back in range again to get the follow-up quest.

Or, even better. Is there a way to make it so that you have to click the unit to pick up a quest instead of just getting in range?
 
Of course,
  • Trigger1
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • For each (IntegerA) from 1 to 12, do (Actions)
      • Loop - Actions
        • Trigger - Add to Trigger2 <gen> the event (Player - Player(IntegerA) selects a unit)
  • Trigger2
  • Events
  • Conditions
    • (Triggering unit) Equal to Sergeant Jeffrey 0094 <gen>
  • Actions
    • Set Points[1] = (Position of (Triggering unit))
    • Set Points[2] = (Position of (your hero))
    • If (All conditions are true) then do (Actions)
      • If - Conditions
        • (Distance between Points[1] and Points[2]) Less than or Equal to 150.00
      • Then - Actions
        • //
      • Else - Actions
    • Custom script: call RemoveLocation (udg_Points[1])
    • Custom script: call RemoveLocation (udg_Points[2])
your hero is the hero the player has. You can store him on the player with a hashtable, like this:
  • Trigger3
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hashtable = (Last created hashtable)
  • Trigger4
  • Events
    • Unit - A unit sells a unit
  • Conditions
    • ((Sold unit) is a Hero) Equal to True //Boolean comparison
  • Actions
    • Hashtable - Save (Sold unit) as (Key(hero)) of (Key(Owner of (Sold unit))) in Hashtable //This is the Hashtable - Save Unit action
So, when you want the (Position of (your hero)), you will:
  • Set Points[2] = (Position of (Load (Key(hero)) of (Key(Triggering Player)) from Hashtable)
You can also add an ability on Sergeant Jeffrey, so that, when it's cast it will give the quest. The problem is that you cannot detect (easily) the player who casted the ability, but you can pick up every unit around your Sergeant and give the quest.
 
Level 7
Joined
Apr 7, 2009
Messages
241
All that for just making it so that you click the questgiver instead of only come in range? o.o

How do I do if I just want the player to leave range and go back in range to recieve the next quest in the chain like I mentioned in my first post?
 
Last edited:
Level 9
Joined
Jun 7, 2007
Messages
195
You could somehow store the information of your visits and make it so that the trigger that's used for getting the follow up quest, requires that the information about your visits indicate that it's not your first visit, otherwise you won't get the follow up quest.

And do you need this to be player, unit or team specific thing?
So that each player can go get the follow up for themselves or that it's a shared quest for a team.
 
Status
Not open for further replies.
Top