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!
I'm working on an rts/fps where you play against eachother normally but at any time you can jump in the game and be one of your units in first person mode. However, I think the best way to do the first person mode would be to use the mouse for looking around and shooting while arrow keys move your unit.
Is there any function in NORMAL WC3 JASS that will allow me to get the mouse position? also, a detecting a click function would be great, too. Could someone write me something up?
Basically, unless it is a small map, it will be very hard to create a decent FPS system without the help of RtC natives.
But if you do want to detect it, you'd have to resort to the unfinished trackable API.
JASS:
constant native GetTriggeringTrackable takes nothing returns trackable
constant gameevent EVENT_GAME_TRACKABLE_HIT = ConvertGameEvent(7)
constant gameevent EVENT_GAME_TRACKABLE_TRACK = ConvertGameEvent(8)
native CreateTrackable takes string trackableModelPath, real x, real y, real facing returns trackable
native TriggerRegisterTrackableHitEvent takes trigger whichTrigger, trackable t returns event
native TriggerRegisterTrackableTrackEvent takes trigger whichTrigger, trackable t returns event
Trackable Hit is when a click occurs and trackable track is hovering over a position. Trackables are not destroyable, thus, for about every ~10,000 or so it can chunk off about 10 or so fps based on your system. [and that was tested in an empty map =P ]
However, if you are determined enough you can make it work. I'll make a brief explanation.
Trackables are developed via models. Hence takes string trackableModelPath.
When you input a model's path, they will be able to track when you select that model. Say you make a peasant. Each time you click a part of the trackable peasant's body, it will register the trackable "Hit" event. When you hover over the trackable peasant's body, it will register the trackable "Track" event. Now, sometimes we don't want a trackable model though, since we want it to be invisible. Well, blizzard included nifty invisible platforms.
TrackMap's are for the general layout and method for creating trackables over an area and trackable2 shows a useful method for z and creating for players.
Generally, for an FPS system you would probably need to create grid-like trackables over the map and then have several layers for the camera's up and down movement. Overall, that's why I suggest using RtC. (Although, I don't know how multiplayer friendly that is) Else your map will lag.
Also note that creating about 1000 or so trackables with Z using the destructible technique will most likely crash a user or at least make a very long lag spike. =)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.