• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

FirstPerson Movement

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
<span style="color:#FF0000">>>> UPDATED <<<</span>
This system can be used to make units walk in first person games. Now you area able to turn while moving, look around and more..
Contents

FirstPerson Movement (Map)

Reviews
15:57, 8th Oct 2009 TriggerHappy187: This leaks a lot and is buggy. Needs some fixing.

Moderator

M

Moderator

15:57, 8th Oct 2009
TriggerHappy187:

This leaks a lot and is buggy. Needs some fixing.
 
Please leave comments, some feedback is always welcome. :D

This spell is made 100% from scratch. You are able to move your unit in first person view (Actually, any view from the back). :p

You have seen quite a lot of this kind of spells. As far as I know in other ones you are not able to turn while you are running. In this system you can! :wink:

You are able to modify how fast units are going to turn. Also if turning speed is too slow for you, you can quickly double click Right/Left to turn 90 degrees in that direction. And some other things. :)

Anyway, give it a try and pla include credits when you use it. :D
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Okay well first of all; I know how to fix that bug... I think.

Add this action to your periodic event -
Set (Camera Field - Height Offset) to Real(or integer I'm not sure which works) Movement - Height of unit;

Again I havn't tried this but using Camera Height Offset is a useful tool... it sets camera target to a point above your head, so it works with turns;
 
Level 18
Joined
Jan 21, 2006
Messages
2,552
Berbanog is my account-name on Battle.Net (USEast).. Also some computers may have something to say about your Up+Down+Right.. and even more with Up+Down+Left; some computers make a beeping noise (not mine but i know how to turn it off) if they are given commands like this; i suggest u convert your code to JASS and where it says Down Key or w/e give the KeyCode for like G or H or something..
 
Hmmm...well where shall I start. Such thing as "Height of unit" does not excist. FLYING Height does but that is only for flying units.

Also when I convert the trigger that when Player red presses right arrow key a text comes up I end up with this. How is it ment to look like? :?

function Trig_Melee_Initialization_Actions takes nothing returns nothing
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_001" )
endfunction

//===========================================================================
function InitTrig_Melee_Initialization takes nothing returns nothing
set gg_trg_Melee_Initialization = CreateTrigger( )
call TriggerRegisterPlayerKeyEventBJ( gg_trg_Melee_Initialization, Player(0), bj_KEYEVENTTYPE_DEPRESS, bj_KEYEVENTKEY_RIGHT )
call TriggerAddAction( gg_trg_Melee_Initialization, function Trig_Melee_Initialization_Actions )
endfunction
 
Level 4
Joined
Aug 6, 2005
Messages
64
Um, interesting but sortof old idea (at least for me) because I put a first-person view in my last map several months ago and it also allowed you to turn and the camera follow you. So I will give it a 4/5 as its already been done before, but still good because I was not as generous as you and didn't give my system away.
 
Yay, I've updated it! :D
Now you area able not just walk but also look around.
I've changed the "Looking" system that used to require 3 buttons to be pressed at the same time which caused beeping error. :wink:
Also I gave an example of how you can fix the bug which made camera go into objects when you walk over high areas.

Anyway, enjoy and plz give feedback. :D :D :D
 
I've tried doing the same thing about a half year ago, but i stopped trying, when I found out that the camera height was buggy. Always when the hero ran uphill, soon I could only see his feet.

I see you have the same problem too

Please PM me if you find out how to fix it (without using regions. And I have tried setting the camera height to unit movement height, but it doesn't work. Probaply because it's meant for being used for flying units...)

Oh yes and you have named it incorrectly
First Person = View from units eyes (the camera should be in front of the unit
Third person = View from behind or quite near

Also saw that the marine doesn't walk very smoothly.
Especially when you get near the bridge the camera doesn't show the marine and when I'm trying to walk forward, the marine suddently starts facing left,right left and camera shows to wrong direction for a moment...

Still... The looking system was ok I think, but not very useful for me...
 
Oh yes and you have named it incorrectly
First Person = View from units eyes (the camera should be in front of the unit
Third person = View from behind or quite near

Yeah I know, I named it that way because it can be used as a 1st person Movement. If I say third person then people might think that it is used with the Strategy (Above Battlefield) camera.

Also saw that the marine doesn't walk very smoothly.
Especially when you get near the bridge the camera doesn't show the marine and when I'm trying to walk forward, the marine suddenly starts facing left, right left and camera shows to wrong direction for a moment...
Well I don't quite understand what you mean by "when I'm trying to walk forward, the marine suddenly starts facing left, right left and camera shows to wrong direction". I tried it out and by the bridge camera is working fine except that in beginning it is too high and you can't see the unit. As I've explained in the readme you can fix this by having more regions. I made only 1 to keep it simple to other people.

Still... The looking system was ok I think, but not very useful for me...
Yeah I didn't really expect that it would be useful to every single person. But if someone wants it then it is there. :wink:
 
Level 3
Joined
Feb 2, 2006
Messages
47
hi all i'm new. I was impressed with the concept of this so i downloaded it but when i tryed editing the map and saving it, a message popped out saying

Line 1704: Expected a name

what do i do?
 
Level 3
Joined
Jun 4, 2005
Messages
44
5/5 for a the camera systems compared to the ones ive seen.
::few sugestions::
--make your camera auto set back after using look
(i had a terrible camera veiw after i used it and had to try and move and use look at the same time = not cool)
--is there a swifter {smother) way when moving the camera up when going over bridges also i would have the camera point more at the ground then forword so you still see your guy (also means you might have to make the camera go up a bit more then before)
--When being attacked like if you hit the space bar your char and camera will auto face that direction
(would be nice for rpgs)

overall good system ^^
 
Level 3
Joined
Feb 2, 2006
Messages
47
redownloaded it but this time it was different. First i did a normal test on your map and it worked but then i added soem passive and enemy units and even without saving i tested it but this poped up.

the error this time was Line 1724:Expected a name
plus this was highlighted

call SetCameraFieldForPlayer( GetOwningPlayer(udg_MovingUnit[GetForLoopIndexA()]), Error, ( GetUnitFlyHeight(udg_MovingUnit[GetForLoopIndexA()]) + udg_Camera_Height[GetForLoopIndexA()] ), 0.01 )
 
make your camera auto set back after using look
So what you are saying is that when you begin the "Walking Mode" the camera automatically resets? Well I made it on purpose so if people want to change the camera view, but I will make a button that resets the camera.

When being attacked like if you hit the space bar your char and camera will auto face that direction
Good idea I will put this in! :D

Battle Modler, this is the part of a trigger that sets how high the camera is, I will look and see what might have caused the error, also, when does this error occur, when you press "Test", when you save...
 
Level 3
Joined
Feb 2, 2006
Messages
47
still have the error Line 2039: expected a name

underlined this time

call SetCameraFieldForPlayer( GetOwningPlayer(udg_MovingUnit[GetForLoopIndexA()]), Error, ( GetUnitFlyHeight(udg_MovingUnit[GetForLoopIndexA()]) + udg_Camera_Height[GetForLoopIndexA()] ), 0.01 )
 
Level 3
Joined
Feb 2, 2006
Messages
47
to let you know what happened now was i put a netural Pandaran or whatever and tested it without save but when it got up to varriations, it was moving back and forth and then the error showed up plus WC3 didn't play it.
 
Level 3
Joined
Jun 4, 2005
Messages
44
/I would try to help u on the code but i dont know how to do that yet.\
-----------------------------------------------------------------------------------------
|(downloading updated system now)|
-----------------------------------------------------------------------------------------------------------
Edit: Very nice! Hehe nice camera set up i didnt see the back of to many houses even when i tried to =D i like that (last time i didnt "try" to see how bad it can get, and it dosent get that bad =D i would have to say 5/5 for every where but the bridge. You kinda lose your self "right" before you get off all the way on the bridge. Although the reason (i think) is because you have a drop on ur bridge lol if you use WEU and use height and raise the ground up to the edges of both sides of the bridge it should fix it a "bit". Or move the cliff out a little bit on both sides so the bridge rests more in the water then on the sides of the cliffs.
/-------------------------------------------------------------------------------------------By the way your terrain is pretty nice.
-But could u make ur map a little bit bigger (in map discrption) for your system so maybe you could add | some rolling plain and lil forest so people can see how it looks in diffrent areas (maybe in the forest | you might want to stick a region in it that makes your camera ether get closer to your guys head or above| higher so you dont see the back of every tree, and in the plains too if you make it really "roll" lol.)
--------------------------------------------------------------------------------------------Flying Camera:this is random but after your done with this system, i would think it would be intresting to make a flying camera system where the camerea is attached to the unit like in your system but instead its flying. But with clouds ^^ must have clouds =D lol, and making the camera sway up and down
like in real flying that would be cool.
----------------------------------------------------------------------------------------Overall:**Raiting:5/5**

:D :D :!:


btw. when people say save they mean like Blizzard save not like trigger/system save right?
Blizzard save= In the game menu
Trigger/Sytem save= -save then -load 2343213421343214321 extra extra :lol:
 
Ok, people for the last time. I know that camera is too high in begining and the end of the bridge. As I already mentioned like 20 times just make 3 regions. One in the begining, one in the middle and one at the end. Set up the heights and the distance to target as it suits you. I made it just one Region so people will get the idea.

after your done with this system, i would think it would be intresting to make a flying camera system where the camerea is attached to the unit like in your system but instead its flying.
I am not quite sure what you mean. When you apply the camera height and select the Flying unit, the camera will be as high as flying unit+the height you set up for your map, so yes it can be used for flying already.
Note: When you use flying unit you don't need to set up all the regions above high areas like above the bridge for walking units.

And Battle Modler, sry but I ceriousley don't know what can be the problem. did you try to save without puting the neutral unit in?
 
Level 3
Joined
Jun 4, 2005
Messages
44
I wasnt saying the camera was wrong i was saying that your terrain is wrong, the bridge is to0 high and that you could fix it by ether, rasing the dirt on both sides or moving the cliffs out so you dont a bridge that is on "top" of 2 cliffs.
------------------------------------------------------
I was talking about a flying movment system where you can fly up and down while being able to fly forwards or backwards /sideways. ^^ sense you already have the camera all you would need to do is make a niffty trigger for flying.
 
Level 6
Joined
Apr 4, 2005
Messages
299
This is EXACTLY what I need, but only think I see wrong is that interface. Why are you using abilities? If someone (I for example:) ) wants to use it he must remake it.
Next time use dialogue displayed after pressing ESC.

I want also say I currently implementing this as movement system in my greatest project (and I will give you credit, ofc).

And to cameras: Cameras are like flying units, so if you place it near some cliff and I see no way to fix it. It is simply W3 engine.
 
Why are you using abilities? If someone (I for example:) ) wants to use it he must remake it.
Next time use dialogue displayed after pressing ESC.
Well, you can use spell book ability if you want. I've made it based on Abilities to make it quicker. So while you walk and you want to look right then you just press 1 button and carry on walking and would not have to stop and search and press some more buttons.
 
Level 3
Joined
Nov 6, 2005
Messages
17
Very nice ! :) i am giving it a 4.5/5 still it needs a little bit work to make it perfect

This could be a good idea for Multiplayer games and also making the characters heroes so they can take XP from killing adding abilities each level.Could make it real cool. Good Job Virus
 
Level 2
Joined
Jun 23, 2007
Messages
6
umm whenever i put it into my map it just shows under the ground like you said would happen on a bridge but everywhere
 
Level 5
Joined
Jun 18, 2007
Messages
68
Found some wierd stuff. Well I guess they be bugs or something. Upon clicking the unit, turn around and face one of the braziers, or fire pole things... whatever they be. Then press either left or right and hold for about five to ten seconds. Now while holding either one (not both) press up and the camera and unit both sperate each other from themselves. So you end up seeing your unit going somewhere while you actually get a 1st person camera. For a bit. Leaving doodads and going to open areas fixes this though. But its a strange thing to see.

Also!!! The camera only fits with units of size 1.00. Units with reduced size, like 0.60 and below really arent viewable and such. Also, when using this in a map where the terrain is made of NO CLIFFS the camera appears below ground. And is completly useless.
 
Level 4
Joined
Dec 15, 2007
Messages
96
This is the best arrow movement system ever. Downloaded this, tried it, tried to copy into my map but failed once. Downloaded some &quot;simpler&quot; ones, but they were all sucky. So I went back to trying to get this system into my map, and got it working just perfect. Many thanks for this system.
 
Level 3
Joined
Aug 16, 2007
Messages
30
great work, indd... but I agree with Pyritie that it's too far away to be a 1.person...
btw, trigger comments are usefool :p
 
Level 5
Joined
Aug 2, 2008
Messages
123
I imported it to my map but it wouldnt work properlly..
whenever I selected a unit
it zoomed in like 10000000 and all I saw was a black screen
 
For start: this system is very hard to implement for a GUI system, since the variables are all initialized in the variables editor when they should be done so in a trigger; otherwise their values will not be transfered into the new map.
Second; it leaks. Oh my, it leaks. Every 0.5 second you create a new location (thats 24 locations per sec if you play full house) and none of those are deleted. I had to wait several minutes after testing for the memory to clean up.
And third, i think moving by 100 each time makes moving very unprecise since you cant move arround in areas with narrow pathing, that would cause you to hopelessly bounce around like there's no tomorrow.
I changed it to 25 each 0.33 second instead, it's still not perfect imo, but that cant be helped since warcraft cant calculate much faster.

Finally; there IS a way to find unit height!
Using GetUnitZ(), which is a jass function though, still you could call GetUnitZ(udg_PointWhereourHeroIs) and set camera offset to that.
Preferably you should check it a bit in front of the unit to make it run more smoothly.


EDIT:
I must say i really liked the system apart from above points, the camera distance and angle were all really nice, the doubble-tap turn was very useful, and many of the features were simply that nice.
 
For start: this system is very hard to implement for a GUI system, since the variables are all initialized in the variables editor when they should be done so in a trigger; otherwise their values will not be transfered into the new map.
Second; it leaks. Oh my, it leaks. Every 0.5 second you create a new location (thats 24 locations per sec if you play full house) and none of those are deleted. I had to wait several minutes after testing for the memory to clean up.
And third, i think moving by 100 each time makes moving very unprecise since you cant move arround in areas with narrow pathing, that would cause you to hopelessly bounce around like there's no tomorrow.
I changed it to 25 each 0.33 second instead, it's still not perfect imo, but that cant be helped since warcraft cant calculate much faster.

Finally; there IS a way to find unit height!
Using GetUnitZ(), which is a jass function though, still you could call GetUnitZ(udg_PointWhereourHeroIs) and set camera offset to that.
Preferably you should check it a bit in front of the unit to make it run more smoothly.


EDIT:
I must say i really liked the system apart from above points, the camera distance and angle were all really nice, the doubble-tap turn was very useful, and many of the features were simply that nice.

To the author of this system: I have a revamped version of this that i'm using for one of my maps, it has all the leaks removed and all the above points fixed. If you want, i can upload it for you.
 
Top