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

[Solved] Dialog right after spell/item usage

Status
Not open for further replies.
Level 3
Joined
Jun 16, 2016
Messages
50
Hello guys, i'm just trying to use trigger to this.
When u use map (item) then will show up a dialog with options of "cities" and it get pinged where the city is.
Here are the triggers , could someone help me please?

  • dialog loop
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Dialog - Clear oznaceni_mesta
      • Dialog - Change the title of oznaceni_mesta to Town list
      • Dialog - Create a dialog button for oznaceni_mesta labelled Ivanovo
      • Set oznaceni_mesta_tlacitko[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for oznaceni_mesta labelled Rybinsk
      • Set oznaceni_mesta_tlacitko[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for oznaceni_mesta labelled Niznij Novogrod
      • Set oznaceni_mesta_tlacitko[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for oznaceni_mesta labelled Nachodka
      • Set oznaceni_mesta_tlacitko[4] = (Last created dialog Button)
      • Dialog - Create a dialog button for oznaceni_mesta labelled Pryluk Skalka
      • Set oznaceni_mesta_tlacitko[5] = (Last created dialog Button)
      • Dialog - Create a dialog button for oznaceni_mesta labelled Staryj Elektrostai
      • Set oznaceni_mesta_tlacitko[6] = (Last created dialog Button)
      • Dialog - Create a dialog button for oznaceni_mesta labelled Novy Elektrostai
      • Set oznaceni_mesta_tlacitko[7] = (Last created dialog Button)
      • Dialog - Create a dialog button for oznaceni_mesta labelled Berezniky
      • Set oznaceni_mesta_tlacitko[8] = (Last created dialog Button)
      • Dialog - Create a dialog button for oznaceni_mesta labelled Tomsk
      • Set oznaceni_mesta_tlacitko[9] = (Last created dialog Button)
      • Dialog - Create a dialog button for oznaceni_mesta labelled Pushkino
      • Set oznaceni_mesta_tlacitko[10] = (Last created dialog Button)
      • Dialog - Create a dialog button for oznaceni_mesta labelled Jelec
      • Set oznaceni_mesta_tlacitko[11] = (Last created dialog Button)
      • Dialog - Create a dialog button for oznaceni_mesta labelled Krasnodar
      • Set oznaceni_mesta_tlacitko[12] = (Last created dialog Button)
      • Dialog - Show oznaceni_mesta for (Owner of (Triggering unit))
      • Trigger - Turn off (This trigger)
  • ma mapu
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Map
      • ((Owner of (Triggering unit)) controller) Equal to User
    • Actions
      • Hero - Set (Triggering unit) Hero-level to 2, Hide level-up graphics
      • Hero - Learn skill for (Triggering unit): Map
      • Set temp_reg = (Playable map area)
      • Visibility - Create an initially Enabled visibility modifier for (Owner of (Triggering unit)) emitting Fog of war across temp_reg
      • Custom script: call RemoveRect(udg_temp_reg)
  • tlacitka KopĂrovat
    • Events
      • Dialog - A dialog button is clicked for oznaceni_mesta
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to oznaceni_mesta_tlacitko[(Integer A)]
            • Then - Actions
              • Cinematic - Ping minimap for (Player group(hraci[(Player number of (Triggering player))])) at (Center of oblastix[(Integer A)]) for 1.00 seconds, using a Simple ping of color (100.00%, 100.00%, 100.00%)
            • Else - Actions
              • Do nothing
  • Untitled Trigger 001 KopĂrovat
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • ((Triggering unit) has an item of type Map) Equal to True
    • Actions
      • Trigger - Turn on dialog loop <gen>
 
Last edited:
Well you have to create dialog only once.
Change its Event to Time Elapsed =0 or Map Init.

Move the Show Dialog-Action and the Set-Title Action inside the "Uses an Item"- Trigger.
YOu will not need this disable Trigger-Actions

Fixing the Location-Leak inside the Ping trigger may be a good idea.
Either by using a tempomary Location and Remove it after pinging
or save all Locations in your Init Trigger inside an Array and use the correct one.

Hm you encounter the max limit of Dialog-Buttons inside one Dialog. I think its 8 Buttons or something like this.
Try to make the dialog page based. Each Page represents another Dialog and with a Button insde a Page you switch Pages.
  • Each Page constains some Cities, maybe 5, and a Button which will open the next Page or the first if the last Page does that.
The switch Button just shows the next Dialog the Triggering Player.
 
Last edited:
Level 3
Joined
Jun 16, 2016
Messages
50
  • Untitled Trigger 001 KopĂrovat
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Map
    • Actions
      • Dialog - Clear oznaceni_mesta
      • Dialog - Change the title of oznaceni_mesta to Town list
      • Dialog - Show oznaceni_mesta for (Owner of (Triggering unit))
After i did it like u said , the dialog box sitll dont show up, dunno why
 
Level 3
Joined
Jun 16, 2016
Messages
50
  • Untitled Trigger 001 KopĂrovat
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Map
    • Actions
      • Dialog - Change the title of oznaceni_mesta to Town list
      • Dialog - Show oznaceni_mesta for (Owner of (Triggering unit))
  • dialog loop
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- DIALOG 1 --------
      • Dialog - Create a dialog button for oznaceni_mesta labelled Ivanovo
      • Set oznaceni_mesta_tlacitko[1] = (Last created dialog Button)
      • Dialog - Create a dialog button for oznaceni_mesta labelled Rybinsk
      • Set oznaceni_mesta_tlacitko[2] = (Last created dialog Button)
      • Dialog - Create a dialog button for oznaceni_mesta labelled Niznij Novogrod
      • Set oznaceni_mesta_tlacitko[3] = (Last created dialog Button)
      • Dialog - Create a dialog button for oznaceni_mesta labelled Nachodka
      • Set oznaceni_mesta_tlacitko[4] = (Last created dialog Button)
      • Dialog - Create a dialog button for oznaceni_mesta labelled Pryluk Skalka
      • Set oznaceni_mesta_tlacitko[5] = (Last created dialog Button)
      • -------- TLACITKO NEXT --------
      • Dialog - Create a dialog button for oznaceni_mesta labelled Next
      • Set oznaceni_mesta_tlacitko[13] = (Last created dialog Button)
      • -------- DIALOG 2 --------
      • Dialog - Change the title of dialog2 to Town list 2/2
      • Dialog - Create a dialog button for dialog2 labelled Staryj Elektrostai
      • Set oznaceni_mesta_tlacitko[6] = (Last created dialog Button)
      • Dialog - Create a dialog button for dialog2 labelled Novy Elektrostai
      • Set oznaceni_mesta_tlacitko[7] = (Last created dialog Button)
      • Dialog - Create a dialog button for dialog2 labelled Berezniky
      • Set oznaceni_mesta_tlacitko[8] = (Last created dialog Button)
      • Dialog - Create a dialog button for dialog2 labelled Tomsk
      • Set oznaceni_mesta_tlacitko[9] = (Last created dialog Button)
      • Dialog - Create a dialog button for dialog2 labelled Pushkino
      • Set oznaceni_mesta_tlacitko[10] = (Last created dialog Button)
      • Dialog - Create a dialog button for dialog2 labelled Jelec
      • Set oznaceni_mesta_tlacitko[11] = (Last created dialog Button)
      • Dialog - Create a dialog button for dialog2 labelled Krasnodar
      • Set oznaceni_mesta_tlacitko[12] = (Last created dialog Button)
      • -------- TLACITKO BACK --------
      • Dialog - Create a dialog button for dialog2 labelled Back
      • Set oznaceni_mesta_tlacitko[14] = (Last created dialog Button)
  • tlacitka KopĂrovat
    • Events
      • Dialog - A dialog button is clicked for oznaceni_mesta
      • Dialog - A dialog button is clicked for dialog2
    • Conditions
    • Actions
      • -------- 2 STRANA --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to oznaceni_mesta_tlacitko[6]
        • Then - Actions
          • Dialog - Change the title of dialog2 to Town list (2/2)
          • Dialog - Show dialog2 for (Triggering player)
          • Skip remaining actions
        • Else - Actions
      • -------- 1 STRANA --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Clicked dialog button) Equal to oznaceni_mesta_tlacitko[14]
        • Then - Actions
          • Dialog - Change the title of oznaceni_mesta to Town list (1/2)
          • Dialog - Show oznaceni_mesta for (Triggering player)
          • Skip remaining actions
        • Else - Actions
      • -------- PINGOVANI MESTA --------
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Clicked dialog button) Equal to oznaceni_mesta_tlacitko[(Integer A)]
            • Then - Actions
              • Set temp_reg = oblastix[(Integer A)]
              • Cinematic - Ping minimap for (Player group((Triggering player))) at (Center of temp_reg) for 1.00 seconds, using a Warning ping of color (100.00%, 100.00%, 100.00%)
              • Custom script: call RemoveRect(udg_temp_reg)
            • Else - Actions

So it looks like this right now , but still no dialog box shows up xD
 
Level 3
Joined
Jun 16, 2016
Messages
50
After i used this trigger
  • Untitled Trigger 001 KopĂrovat
    • Events
      • Time - Elapsed game time is 5.00 seconds
    • Conditions
    • Actions
      • Dialog - Change the title of oznaceni_mesta to Town list
      • Dialog - Show oznaceni_mesta for Player 1 (Red)
The dialog box just poped up. It seems like Dialog boxes cant be opened by Unit/item interaction?
 
They can, i already did this.

Oh found something critical don't know if it solves this problem but will for sure bring trouble.
You posted an trigger which removes "Playable Map Area". You shouldn't do that it is needed later for sure and doens't Leak. PlayableMap Area is a constant created at Map init.
From Jass API:
Code:
//===========================================================================
// Query the playable map area, as defined at map init.
//
function GetPlayableMapRect takes nothing returns rect
    return bj_mapInitialPlayableArea
endfunction
 
Last edited:
Level 3
Joined
Jun 16, 2016
Messages
50
I know which spell but im thinkin' about most times if they are usable they will disappear likes times , buffs etc.
 
Level 3
Joined
Jun 16, 2016
Messages
50
Okay i got this , only problem was that my item had no ability/spell , cos of my friend which is workin' wit me , made it from moon key and forgot to make a spell too. Thanks Tasyen for your time <3 +rep
 
Level 3
Joined
Jun 16, 2016
Messages
50
Btw..just next error here...Is there any possible reason when i use that item it looks like dialogs gonna show up but it just keeps look like paused game but no dialogs?
 
Level 3
Joined
Jun 16, 2016
Messages
50
I just got no clear action in that trigger

EDIT : I just removed map init func , and used elapsed game time and the trigger started to work , is there any maximum map init commands in one trigger?
 
Status
Not open for further replies.
Top