• 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] UnitVisionCamera

Status
Not open for further replies.
Level 3
Joined
Feb 13, 2014
Messages
26
Hey guys. This will be my first thread in this forum: D . I’m not very experienced in forums so I apologize in advance for any misplacement of this thread. I have been learning a lot of stuff from the tutorials here and I wanted to contribute with some of my work.
I made a pretty simple system for those who might want a more of a 3rd person view in their games. The sample map is pretty much debugging mode so don’t pay much attention to the floating data.

Any feedback related to making it more efficient is also appreciated :wink:

1EmCoBSaPQ8TkD13YIGccn
 

Attachments

  • UnitVisionCamera.w3x
    30.1 KB · Views: 37
Last edited:
This forum is for the case you have a concrete problem with your trigger.

But here is Feedback:

Dont use things like "last created floating text" after waits. This might refer to the wrong floating.

Dont use "Do nothing". It is useless function.

You have periodic memory leaks, read a tutorial about memory leaks. You can find a link in my signature.

Make it MUI.

Don't use pre-set data like "Footman 0000" in your code.
________________________________

For getting X/Y of your unit you create locations atm. Use custom script instead:

set udg_variableX = GetUnitX(unit)
set udg_variableY = GetUnitY(unit)

"variable" should represent your real variable. You need the "udg"-prefix if you use GUI variables in JASS.

"Unit" represents the unit of which you want get the coordinates. (Don't use Footman 0000 here, but use variables)
________________________________

Your position trigger works bad. You have a periodic event so it fires each .1 seconds.

Then you set X/Y of unit and wait .1 seconds then you again set new X/Y of unit and compare them.

Do not use the wait here. (waits are not 100% accurate).. Instead get the X/Y of unit and store them into variables.
So you also can compare the current X/Y with these variables.

After your comparisson, store the new values of X/Y into the variables so you can use them in next run again. And so on..
 
Level 3
Joined
Feb 13, 2014
Messages
26
Thanks

Thanks! I applied everything you said, I’m practically learning WE from zero and I feel kind of silly at the moment because I was checking the GUI actions for camera and I noticed a function that get "facing of unit" :eekani: apparently it does the same. I did manage to do it without using it but still hehe. :xxd:

  • Camera - Set Player 1 (Red)'s camera Rotation to (Facing of unit) over 0.50 seconds
I’m thankful because you probably knew that by the time you replied and still stayed objective thanks it really helped me.
 
Status
Not open for further replies.
Top