Structs

AdamGriffith

You can change this now in User CP.
Reaction score
69
I just want one trigger. No extra systems.
This does work, but it's just long and something tells me their is an easier way... xD
 

chobibo

Level 1 Crypt Lord
Reaction score
48
Listen to flare, coz I'm not good at coding spells lol. Also could you give a description on how your spell works. I can't understand what you want to do.
 

AdamGriffith

You can change this now in User CP.
Reaction score
69
Basically, i've got a non-mui version of myspell.
And i'm trying to make it MUI.

The part I am having trouble making MUI, is this part where some objects are created, and then they are rotated around the caster. However, the casters location has to be passed between the function and the callback so I need a way of doing this.
 

AdamGriffith

You can change this now in User CP.
Reaction score
69
What would be the point in that... =S
Why not just reference to them as a.casterx and a.castery
 

Flare

Stops copies me!
Reaction score
662
Why have .casterx and .castery in the first place? You have to follow the syntax with struct members, so that can result in more work since you need to do <struct variable>.<member>

IMO, struct members should only be needed to carry a constant value throughout the 'process' (be it spell, system or whatever). If the value isn't constant, or doesn't need to be kept track of (like XY coordinates for slides), locals will do just fine

If you are rotating around a moving unit, use local reals for XY's. If you are rotating around a specific point for the whole duration, use struct members to keep track of the original point
 

AdamGriffith

You can change this now in User CP.
Reaction score
69
But I have to transfer the caster location to the Timer callback which cannot be done with locals.
 

AdamGriffith

You can change this now in User CP.
Reaction score
69
Okay well fine, same problem though. I need to make it MUI. I wanted to know the best way to do this.
 

AdamGriffith

You can change this now in User CP.
Reaction score
69
Sigh.

Oh well I was trying to avoid that, but I guess if it's my only option...

EDIT:
Or I could just replace the timer with an integer loop with waits... =D
I'm going to try that!
Thanks for the help.
Apparently I can't +rep you... =S
 

Flare

Stops copies me!
Reaction score
662
Integer loop with waits... not the smartest decision I've heard in a while. A wait is gonna be an incredibly inaccurate way of doing it, and it's gonna look very choppy (IIRC, a wait between 0 and 0.1 sec actually takes ~0.3 sec).

To be honest, you're gonna have to use attachment systems eventually (there's nothing wrong with using them, unless they are broken, most of which aren't) since they are insanely useful. IMO, you should look into CSData (part of the Caster System, you can find it over at WC3C), HAIL (over at WC3C), ABC (can be found here, or at WC3C) or HSAS (again, WC3C is the place to go for it :p
 

Flare

Stops copies me!
Reaction score
662
Polled waits uses a timer in conjunction with a TriggerSleepAction, so it's still inaccurate. And it leaks (there's a PolledWait2 over at www.wc3jass.com which doesn't leak, but works in the same way). I can make an example trigger for you if you want using HAIL, but it'd have to wait until tomorrow

Off-Topic: Your location... technically that's an error (unless you're a unit :p)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top