• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Solved] (GUI MPI) Quest system.

Status
Not open for further replies.
Level 10
Joined
Nov 24, 2010
Messages
546
Hello guys, So I'd like to create GUI MPI Quests.
Every player need to take quest to advance quest.
Once 1 player takes it, it displays quest in quest log for everyone with list of player names what are on quest.
Everything works fine, tested it in multiplayer with my friends, only my problem is removing player name from player list when he/she complete quest.
Here are triggers.

Setting names of each Quest.
  • QuestNames
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Quest_Names[1] = Delivery
Accepting Quest and creating Quest.
  • QuestAccept
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Tome of Experience
    • Actions
      • Set DeliveryQ_i = (DeliveryQ_i + 1)
      • Set DeliveryQ_r = (Real(DeliveryQ_i))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DeliveryQBoolean[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You are already on ...
        • Else - Actions
          • Quest - Display to (All players) the Quest Discovered message: ((Name of (Owner of (Triggering unit))) + ( has accepted: + Quest_Names[1]))
          • Set DeliveryQBoolean[(Player number of (Owner of (Triggering unit)))] = True
          • Set DeliveryQPList = (DeliveryQPList + ( + (Name of (Owner of (Triggering unit)))))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DeliveryQ_i Equal to 1
        • Then - Actions
          • Set DeliveryQuestCreated = True
          • Quest - Create a Required quest titled Delivery with the description (Players on this Quest: + DeliveryQPList), using icon path ReplaceableTextures\CommandButtons\BTNAmbush.blp
          • Set DeliveryQ_Q = (Last created quest)
        • Else - Actions
          • Quest - Change the description of DeliveryQ_Q to (Players on this Quest: + DeliveryQPList)
Finishing Quest
Here I have biggest problem, I don't know how to remove player name from quest list when completed :(
  • QuestFinish
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Tome of Agility
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • DeliveryQBoolean[(Player number of (Owner of (Triggering unit)))] Equal to True
        • Then - Actions
          • Quest - Display to (All players) the Quest Update message: (((Name of (Owner of (Triggering unit))) + has completed ) + Quest_Names[1])
          • Set DeliveryQ_i = (DeliveryQ_i - 1)
          • Set DeliveryQ_r = (Real(DeliveryQ_i))
          • Set DeliveryQBoolean[(Player number of (Owner of (Triggering unit)))] = False
        • Else - Actions
          • Game - Display to (All players) the text: You cannot complete...
Destroying quest when there is noone left with it.
  • QuestDestroy
    • Events
      • Game - DeliveryQ_r becomes Equal to 0.00
    • Conditions
    • Actions
      • Quest - Destroy DeliveryQ_Q
+rep and credits for suggestions
 
Level 10
Joined
Nov 24, 2010
Messages
546
Thanks for trying to help, I've solved this by strange way

  • Set DeliverQString[(Player number of (Owner of (Triggering unit)))] = ( + (Name of (Owner of (Triggering unit))))
  • Set DeliveryQPList = (DeliverQString[1] + (DeliverQString[2] + (DeliverQString[3] + (DeliverQString[4] + DeliverQString[5]))))
And when completed DeliverQString(Player Number) = empty string, and again when completed Set DeliveryQPList = (DeliverQString[1] + (DeliverQString[2] + (DeliverQString[3] + (DeliverQString[4] + DeliverQString[5]))))


Note I have max 5 players in map :)
 
Status
Not open for further replies.
Top