• 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.

[Trigger] Problem with selecting Variables

Status
Not open for further replies.
Level 29
Joined
Jul 29, 2007
Messages
5,174
Omg didn't do anything on WE for like a year and now don't remember anything lol :/

Ok the first problem as the title says is selecting a certain variable.
I wanted to make a trigger that when a unit gets close to another unit something will happen, but I can only make this event:
  • Unit - A unit comes within 50.00 of ThisUnit <gen>
And not
  • Unit - A unit comes within 50.00 of UnitVariable <gen>

Second question is, how do I make, say, a gun shot that will be created infront of a unit that is casting a skill (like a lot of maps did e.g. Counter Strike) ?
I did:
  • Unit - Move SomeUnit instantly to ((Position of (Triggering unit)) offset by 40.00 towards (Facing of (Triggering unit)) degrees)
But every time the unit comes inback of the casting unit (yea I tried -40 too... same thing lol)

Please help :infl_thumbs_up:

Just a point of view, is it worth it learning JASS if I never learnt any programming languages ?
It really pisses me off seeing all the COOL stuff people do with JASS and I can't make even 10% of them with the GUI :(
 
Level 10
Joined
Jul 14, 2004
Messages
463
Your first problem:
This is a normal limitation of the GUI, for Specific Unit events it does not let you choose a variable. Well you can do it anyways, if you add the event by a trigger action in your initialization, just use the "Trigger - Add Event" action, there you should also be able to choose a variable.
BUT: If you change the value of the variable ingame, I'm afraid the event won't change. I did not try this out, so you should do it before making use of it.

Second question:
If the Triggering Unit is the casting unit, this should work, there is no problem with it. Possible reason to prevent it from working could be that there is not enough space in front of Triggering Unit for SomeUnit. Changing -40 to 40 but still the same effect also should not be. I think your problem is not in that function.
Anyways: PointWithPolarOffset is useful, but often (in your example, too) leaks even two locations. So you should not use this exactly that way in a trigger which may fire often.


Learning JASS is of course useful, but if you don't have any experience with any programming language until now, it won't be very easy for you in the beginning. On the other hand, if you are familiar to JASS, you will have some advantages if you want to learn another programming/script language!
So if you think you have the time to learn it, just do so, there is no possibility that you could not profit from it at all. :wink:
 
Level 10
Joined
Jul 14, 2004
Messages
463
Ok I got to the conclusion that my map will be pretty much boring without the needed knowledge in JASS so stopped making.
How can you know that you need JASS if you don't know it and don't know what's possible with its help at all?

Just for general knowledge, how would you suggest making a gun shot trigger ? I knew it once, don't remember now :thumbs_down:
This depends on how it should look and what it's based on/which ressources you have. If you have a model with a gun, it should have a useable attack-animation, too. If you want to add a special effect, I'd do it just like you did in your 2nd question; event "unit is attacked" and instead of using Triggering Unit, you will have to use Attacking Unit (of course I'd try to prevent leaking the locations). Maybe a sound should be added, too... well, your question is a little too general. :wink:
 
Status
Not open for further replies.
Top