how to change camera in basic project F2mode by using player_hud UI

how to change camera in basic project F2mode by using player_hud UI

Anonymous
Not applicable
812 Views
4 Replies
Message 1 of 5

how to change camera in basic project F2mode by using player_hud UI

Anonymous
Not applicable

hello  i am trying to change the camera position in basic project F2mode by useing player_hud UI,

 

i set two button, one is for camera1 and another is for camera3 in template_hud.2sd 

i changed each handler.lua like this

1.png

 

and then i added lines in PlayerHud.lua 

2.png

 

3.png

 

and i added checking function in player.lua 

 

4.png

 

5.png

 

like above, i tried to move charactor which is set to move with camera.

but i got the error about unit_index 

6.png

 

i can know something wrong with player.lua, i hope if someone can give an advice.

 

Reply
Reply
0 Likes
Accepted solutions (1)
813 Views
4 Replies
Replies (4)
Message 2 of 5

paulkind
Alumni
Alumni

Take a look atthis video, see if it helps you.  It is a more straightforward way to do what I think you are trying to do.

 

Lemme know if this works for you.

 

https://www.youtube.com/watch?v=vHyoLSQ9jCk

 

Paul

 

Areas of Expertise - MayaLT : Mudbox : 3DS Max : Inventor : Game Dev
Follow me on Twitter : @paulkind3d

Please remember to give kudos freely and mark acceptable answers as solved!

PLEASE do not send me private messages unless asked to do so. If you have a question, start a thread, and ask me on the public forums where answering your question may help others.

Did you know there was a YouTube learning channel for Autodesk Games? New videos are posted regularly with all sorts of content relative to Stingray, Maya/MayaLT, 3DS Max, and other game related tools. Get your game on @ https://www.youtube.com/user/autodeskgameshowtos
Reply
Reply
0 Likes
Message 3 of 5

Anonymous
Not applicable

hello paul

thank you for the advice, 

i have tried with the video, but this time i am using the camera which is spawned and moves with the "character"(in basic project F2mode) 

so can i reposition the character in lua?  

Reply
Reply
0 Likes
Message 4 of 5

paulkind
Alumni
Alumni
Accepted solution

I am not the best lua guy in the world, but i can show you how to do it with flow.

 

Open up the character unit and go into its flow.

 

In there you can use Set Mover Position

 

In the example below t is as simple as it gets but shows that it is as easy as that.  

 

move chracter.PNG

 

You would just need to get the messages from scaleform to set the mover position to the location(s) of your choosing.

 

Working from my tutorial, you can see how i have adjusted the level flow here...  (basically just removed stuff)

 

levelflow_initialize.PNG

 

and then i just call the scaleform events within the unitflow as i did above....  only now im pointing the buttons to the locations instead of using a simple mouseclick.

 

unitFlow_sf.PNG

 

Areas of Expertise - MayaLT : Mudbox : 3DS Max : Inventor : Game Dev
Follow me on Twitter : @paulkind3d

Please remember to give kudos freely and mark acceptable answers as solved!

PLEASE do not send me private messages unless asked to do so. If you have a question, start a thread, and ask me on the public forums where answering your question may help others.

Did you know there was a YouTube learning channel for Autodesk Games? New videos are posted regularly with all sorts of content relative to Stingray, Maya/MayaLT, 3DS Max, and other game related tools. Get your game on @ https://www.youtube.com/user/autodeskgameshowtos
Reply
Reply
Message 5 of 5

Anonymous
Not applicable

hello paul

Spoiler
 

thank you very much for the description,

i could understand how to set it with flow.

i will try that way

Reply
Reply
0 Likes