• 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] Missile System Bug [GUI]

Status
Not open for further replies.
Spinnaker can predict the future and Pharaoh_ can be inactive for 2 DAYS!
I wonder what's my special power? :)
I know! My power is: Being really off-topic and suddenly posting something useful to avoid neg rep :3
Like this:

Possible problems:
Your missile is not moving:
- Make sure it has the Amov ability and a movement speed greater than 0
- For debugging purposes, select the missile when you create it

Your missile is not exploding when it collides with the target:
- Checking to see if the distance is 0 is a wrong approach if the missile has a non-0 collision ;P

Your missile is exploding at the wrong time:
- This is a logic error. You should make sure the conditions for exploding are correct.
- The distance must be re-calculated every 0.031250000 seconds.

Misc:
- Referencing undefined variables will cause a thread to crash:
JASS:
local integer i
local integer k = 0
// We referenced i here and since it's value is undefined (not even null), the thread crashes and the entire trigger will fail.
set k=k+i
 
Zaio; to be honest, ofen the same ppl answer help requests on hive all the time. After sitting here for 5 months helping others I'm pretty good with what given "helper" will start his post.

Maggy's style goes around: we start first sentence with something not thread related, rather funny and then eventually we move to busines.
Pharaoh_/TrollBrain/Bribe/Maker always respond on "empty" post (like that one) with: what's the problem? no triggers posted actually? where is map? And I mostly never respond to such thread in case it just increases my post count, it's better to actually wait untill guy says something important. When I came here knowing none, I was spamming posts all around but now; I know when to wait untill someone else asks: whats the problem actually man?"

Probably there are few users who does exectly the same thing (=
It's somehow funny since I'm pretty much predictable in World Editor Help zone too. But I wont tell how ;P
 
  • Set MissileSystem_Point[1] = (Position of MissileSystem_Dummy[3])
->
  • Set MissileSystem_Point[1] = (Position of MissileSystem_Dummy[MissileSystem_MUI[3]])
  • MissileSystem_Distance[MissileSystem_MUI[3]] Less than or equal to 10.00
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • MissileSystem_Distance[MissileSystem_MUI[3]] Less than or equal to 10.00
    • Then - Actions
      • Unit - Kill MissileSystem_Dummy[MissileSystem_MUI[3]] <------------ Add this line
      • Set MissileSystem_Boolean[MissileSystem_MUI[3]] = False
      • Set MissileSystem_MUI[1] = (MissileSystem_MUI[1] - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • MissileSystem_MUI[1] Equal to 0
        • Then - Actions
          • Set MissileSystem_MUI[2] = 0
          • Trigger - Turn off (This trigger)
        • Else - Actions
    • Else - Actions
 
Your missile system still requires much to be actually efficient and clear:

- replace this old indexing system with dynamic indexing
- deallocation/killing missile/instance finish shouldn't be in GroupEnum; if you do, trigger loops those actions few times, one time per unit picked ;/
- 'MissileSystem_Caster[]' parameter should be nulled at instance finish since it's unit array variable.
- loop trigger leaks group, use either 'bj_wantDestroyGroup = true' or create custom group and create/destroy it manually.
- point variables shouldn't be array types; use two non-araays instead - right now you waste a lot of memory
- in 'Fire Missile' trigger: you set variables to unit, angle etc. but later you still call (Triggering unit)/(Facing of (Triggering unit)) etc. Whats the point? Use the vars instead;
- (Owner of (Triggering unit)) -> (Triggering player)
- in loop trigger: check if trigger should be turned off only once; less code -> more speed

Those statements I've posted above leads to actually rewritting whole system/spell.
 
Status
Not open for further replies.
Top