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

Missile System Problem

Status
Not open for further replies.
Level 9
Joined
Sep 20, 2015
Messages
385
Hello i am using this missile system Missile [GUI] version 1.6.1 . I think i figured out how to use it but i have a strange behavior in my map.

What i want to do is an ability that shoots missiles in the mouse cursor position when the right mouse button si pressed.

I do this is 3 triggers

First one when the mouse button is pressed

  • HLP
    • Events
      • Player - Player 1 (Red) issues Mouse Down event
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Mouse Position X for Triggered Mouse Event) Not equal to 0.00
          • (Mouse Position Y for Triggered Mouse Event) Not equal to 0.00
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Archmage Selectable 0001 <gen> has buff Avatar) Equal to True
            • Then - Actions
              • Countdown Timer - Start ArcaneMissileTimerCasting as a One-shot timer that will expire in 0.05 seconds
            • Else - Actions
        • Else - Actions

The second for the missile configuration and creation

  • MissilesShoot
    • Events
      • Time - ArcaneMissileTimerCasting expires
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • RED_Mouse_Right_Down Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Archmage Selectable 0001 <gen> has buff Avatar) Equal to True
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (X of Mouse_Cursor_Position_P1) Not equal to 0.00
                  • (Y of Mouse_Cursor_Position_P1) Not equal to 0.00
                • Then - Actions
                  • Set MissileOrigin2 = (Mouse_Cursor_Position_P1 offset by 1700.00 towards 270.00 degrees)
                  • Set MissileImpact2 = Mouse_Cursor_Position_P1
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Mana of ArchmageSelectable) Less than ManaARCANE_Right
                    • Then - Actions
                      • Set ErrorPlayer = Player 1 (Red)
                      • Set ErrorMessage = Not enought mana!
                      • Custom script: call ErrorMessage(udg_ErrorMessage,udg_ErrorPlayer)
                    • Else - Actions
                      • Unit - Set mana of ArchmageSelectable to ((Mana of ArchmageSelectable) - (ManaARCANE_Right + 0.00))
                      • -------- M I S S I L E S T E S T --------
                      • Trigger - Run Missile Configurate <gen> (ignoring conditions)
                      • Set Missile__Source = ArchmageSelectable
                      • Set Missile__Owner = Player 1 (Red)
                      • Set Missile__Origin = MissileOrigin2
                      • Set Missile__Collision = 16.00
                      • Set Missile__OriginZ = 350.00
                      • Set Missile__Impact = MissileImpact2
                      • Set Missile__ImpactZ = 0.00
                      • Set Missile__Damage = 12.00
                      • Set Missile__Speed = 2200.00
                      • Set Missile__Data = 1
                      • Set Missile__Scale = (Random real number between 0.90 and 2.00)
                      • Set Missile__Arc = (Random real number between 20.00 and 50.00)
                      • Set Missile__Curve = (Random real number between -18.00 and 18.00)
                      • Set Missile__Model = war3mapImported\s_ArcaneRocket Projectile.mdl
                      • Set Missile__OnFinish = AcranceMisslActionsV2LOOP <gen>
                      • Set Missile__OnRemove = AcranceMisslActionsV2LOOP <gen>
                      • Trigger - Run Missile <gen> (ignoring conditions)
                • Else - Actions
            • Else - Actions
        • Else - Actions

And the third one when the missile is destroyed

  • AcranceMisslActionsV2LOOP
    • Events
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Missile__EventId Equal to EVENT_MISSILE_REMOVE
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • RED_Mouse_Right_Down Equal to True
            • Then - Actions
              • Countdown Timer - Start ArcaneMissileTimerCasting as a One-shot timer that will expire in 0.03 seconds
            • Else - Actions
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Missile__EventId Equal to EVENT_MISSILE_FINISH
            • Then - Actions
              • Unit - Cause Missile__Source to damage circular area after 0.00 seconds of radius 135.00 at (Position of Missile__Dummy), dealing 13.00 damage of attack type Spells and damage type Normal
              • Set Missile__WantDestroy = True
            • Else - Actions
So i the third if i understood the system correctly when a missile is destroyed and the right mouse button is pressed it should create another missile, and so on and on as long as the right mouse button is down.
It doesnt work properly also for some reasons when i press the right mouse button the variable Mouse_Cursor_Position_P1 is set to (0, 0) coordinates.
I made some other tests and changes some stuff but it seems that the mouse position point variable is set to 0,0 in the missile trigger.

Help me please.

Thanks in advance
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,583
Looks like you left out some triggers unless I'm just not seeing it because a bunch of these variables are never set.

I've gone ahead and created an example of firing a missile with your mouse using that Missile GUI system you're using. I attached the edited version below. This should give you an idea of how to track the mouse position and then you can implement it into your current design. I'm not entirely sure if your triggers will work though, if you could go into greater detail I could help you.

For example, how many missiles do you want to fire per second? Can multiple missiles even be fired at once or did you want it so that there's only ever 1 missile allowed out at a time?
 

Attachments

  • Missile GUI Uncle EDIT.w3x
    75.5 KB · Views: 18
Level 9
Joined
Sep 20, 2015
Messages
385
Hello and thanks for the response and the map, i will test it later today. I have 3 different triggers for mouse tracking, one on mouse down, mouse up and mouse move. All these triggers set the variable mouse_cursor_position_p1 to the X and Y of the mouse cursor. I i wanted to do i that when one press the mouse a missile is launched and as long as the button is hold down missiles are launched at the mouse position.
The problem i had is that for some reasons the mouse position is set to 0 0 .



EDIT: Hey i tested the map and i figured out what was the problem, i didnt used the missle_temploc variable. Thank you very mutch for the help :)
 
Last edited:
Status
Not open for further replies.
Top