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

[General] My MUI kill quest wont work [Need Help]

Status
Not open for further replies.
Level 8
Joined
Jun 13, 2010
Messages
344
Problem solved.
I had just put the integer +1 inside the array check..
Can somebody delete this post? I can't seem to do so. I do not want to spam with this silly thread.

Hello

So I have just made a simple quest, to make it easy. I am using string arrays.
You accept the quest and return it in trigger 1.

You kill and increase integer value in trigger 2.
But for some reason, when I kill a unit, and the text string goes off (as for the counter) it states:
"You have killed a unit. Total: 0"

I have looked it through. I found some possible errors, but now I am just staring blind. I thought a nights sleep would solve it, but I am lost.
I am also just new to the MUI array system and strings.. So I might have done something stupid along the way.

Oh well, here they are:

Trigger 1:
  • Deliver Quest Skabelon
    • Events
      • Unit - A unit comes within 200.00 of Survivor of Alkarah 0010 <gen>
    • Conditions
      • (Triggering unit) Not equal to Survivor of Alkarah 0010 <gen>
      • ((Entering unit) is A Hero) Equal to True
      • (Owner of (Entering unit)) Not equal to Neutral Passive
      • (Owner of (Entering unit)) Not equal to Player 12 (Brown)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Quest[(Player number of (Triggering player))] Equal to notstarted
        • Then - Actions
          • Game - Display to (All allies of (Owner of (Triggering unit))) for 15.00 seconds the text: Quest accepted.
          • Set Quest[(Player number of (Triggering player))] = started
          • Set Quest_Kill[(Player number of (Owner of (Entering unit)))] = 0
          • Skip remaining actions
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Quest[(Player number of (Triggering player))] Equal to started
        • Then - Actions
          • Game - Display to (All allies of (Owner of (Triggering unit))) for 15.00 seconds the text: Quest is ongoing.
          • Skip remaining actions
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Quest[(Player number of (Triggering player))] Equal to return
        • Then - Actions
          • Game - Display to (All allies of (Owner of (Triggering unit))) for 15.00 seconds the text: Quest completed.
          • Set Quest[(Player number of (Triggering player))] = notstarted
          • Skip remaining actions
        • Else - Actions
          • Do nothing
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Quest[(Player number of (Triggering player))] Equal to complete
        • Then - Actions
          • Game - Display to (All allies of (Owner of (Triggering unit))) for 15.00 seconds the text: Quest is already co...
          • Skip remaining actions
        • Else - Actions
          • Do nothing
Trigger 2:
  • Kill Quest Skabelon
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Corrupted Treant
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Quest[(Player number of (Owner of (Killing unit)))] Equal to started
        • Then - Actions
          • Set Quest_Kill[(Player number of (Owner of (Killing unit)))] = Quest_Kill[((Player number of (Owner of (Killing unit))) + 1)]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Quest_Kill[(Player number of (Owner of (Killing unit)))] Greater than or equal to 3
            • Then - Actions
              • Game - Display to (Player group((Owner of (Killing unit)))) for 5.00 seconds the text: Quest complete.
              • Set Quest[(Player number of (Owner of (Killing unit)))] = return
              • Skip remaining actions
            • Else - Actions
              • Do nothing
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Quest_Kill[(Player number of (Owner of (Killing unit)))] Less than 3
            • Then - Actions
              • Game - Display to (Player group((Owner of (Killing unit)))) for 5.00 seconds the text: (You have killed a unit. Total: + (String(Quest_Kill[(Player number of (Owner of (Killing unit)))])))
            • Else - Actions
              • Do nothing
        • Else - Actions
          • Do nothing
Edit:

I just updated trigger 2 and put the integer counter from the second "if/then/else" and put it atop of them both, making it follow the string condition right after the "started" check.
 
Level 12
Joined
Jan 2, 2016
Messages
973
Umm.. in the 1-st trigger I see that you are using "entering unit", while the event is "a unit comes in range" , not "a unit enters region". Not sure if "entering unit" works with this event.
Apart from that - you could improve the way you use these "ifs", but I don't see anything that could be causing a malfunction.
 
Your idea is good, but where is the state set to "notstarted"?
I suggest to use integer arrays instead, it is more straight forward.

QuestState[] (integer array)
The abstract meanings would be:

0 -> not started
1 -> started
2 -> ready to return
3 -> completed

Pseudo Code
Code:
If (QuestState[index] == 0 then

Then - Actions

---- " Quest was accepted "

Else - Actions

---- If (QuestState[index] == 2 then

---- ---- " Quest was completed "

^This was for "InRange" trigger, and for death trigger something like this:

Code:
Events
---- Unit Dies

Conditions
---- UnitType == Treant
---- QuestState[index] == 1


Actions:
---- Set KillCount[index] = Set KillCount[index] + 1
---- If KillCount[index] >= 3
---- ---- " All kills are done "
 
Last edited:
Level 8
Joined
Jun 13, 2010
Messages
344
Your idea is good, but where is the state set to "notstarted"?
I suggest to use integer arrays instead, it is more straight forward.

QuestState[] (integer array)
The abstract meanings would be:

0 -> not started
1 -> started
2 -> ready to return
3 -> completed

Pseudo Code
Code:
If (QuestState[index] == 0 then

Then - Actions

---- " Quest was accepted "

Else - Actions

---- If (QuestState[index] == 2 then

---- ---- " Quest was completed "

^This was for "InRange" trigger, and for death trigger something like this:

Code:
Events
---- Unit Dies

Conditions
---- UnitType == Treant
---- QuestState[index] == 1


Actions:
---- Set KillCount[index] = Set KillCount[index] + 1
---- If KillCount[index] >= 3
---- ---- " All kills are done "

It is set to "notstarted" in the 3'd if/then/else in trigger 1. :)
Ye nice suggestion with the numbers actually.. But I just got used to this and already made a couple of quests that way. But might concider it in the future. :)
 
Level 8
Joined
Jun 13, 2010
Messages
344
If you think about it, it's set to an empty string in the begining of the map, so none of the ifs will be true. Unless you've set its default value to "notstarted".

I did. :)
But it works now tho.

Would you mind if I ask you another question?

I tried my map with a friend to test it. I had abselutely no problems with lags. However he said he lagged like crazy and after few seconds he disconnected.
I got a bit curious if it could be my Map Initialization triggers which was too much for him. Although he do not seem to have trouble with any other game, so it would be weird if it was Warcraft 3 he couldn't handle..

  • Creep Respawn Point Saver
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set Creep_Respawn_Timer = 70.00
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units in (Entire map) owned by Player 12 (Brown)) and do (Actions)
        • Loop - Actions
          • Set Creep_Respawn_Integer = (Creep_Respawn_Integer + 1)
          • Unit - Set the custom value of (Picked unit) to Creep_Respawn_Integer
          • Set Creep_Respawn_Point[Creep_Respawn_Integer] = (Position of (Picked unit))
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,198
I tried my map with a friend to test it. I had abselutely no problems with lags. However he said he lagged like crazy and after few seconds he disconnected.
Needs to be reproducible. Especially after restarting (close then open again) Warcraft III. Some maps corrupt the Warcraft III caches to increase load speed meaning that different maps played after them will not load properly and the player will almost always out of sync from it.
 
Status
Not open for further replies.
Top