Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

FPSC Classic Product Chat / 3rd person question?

Author
Message
arrojar entidad y que explote
9
Years of Service
User Offline
Joined: 3rd Jan 2015
Location:
Posted: 24th Nov 2016 01:31 Edited at: 24th Nov 2016 01:34

Hello community, I have a question? Anyone know how to add a weapon in 3rd person mode? I can not get the character to have a gun in his hands and can shoot it. Someone can guide me. thank you very much!

Video:

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



This is the script I use:


:state=0:masterobject,hideplrweapon
:State=0:State=1,ReloadWeapon,scale=90,walkkey=1,CrouchKey=1,bindentitytocam=0,offsetcamy=0 0,offsetcamfore=0 0,offsetenty=-32,ThirdPersonHeight=50,ThirdPerson=35 0,DimVar=Crouch,SetVar=Crouch 0


;Animations
;Crouching
:state=1,keypressed=46 1:setvar=Crouch 1,scale=60,ThirdPersonHeight=20,ThirdPerson=20 10,offsetenty=10
:state=1,keypressed=46 0:setvar=Crouch 0,scale=90,ThirdPersonHeight=50,ThirdPerson=35 10,offsetenty=-20

;Idle
:State=1,VarEqual=Crouch 0,keypressed=17 0,keypressed=30 0,keypressed=31 0,keypressed=32 0:Animate=1
:State=1,VarEqual=Crouch 1,keypressed=17 0,keypressed=30 0,keypressed=31 0,keypressed=32 0:Animate=31


;Walk Forward
:state=1,varequal=Crouch 0,plrnotrunning,keypressed=17 1,keypressed=30 0,keypressed=31 0,keypressed=32 0:animationnormal,animate=2,movefore=1
:state=1,varequal=Crouch 1,plrnotrunning,keypressed=17 1,keypressed=30 0,keypressed=31 0,keypressed=32 0:animationnormal,animate=32,movefore=1


;Run Forward
:state=1,varequal=Crouch 0,plrrunning,keypressed=17 1,keypressed=30 0,keypressed=31 0,keypressed=32 0:animationnormal,animate=5,movefore=5
:state=1,varequal=Crouch 1,plrrunning,keypressed=17 1,keypressed=30 0,keypressed=31 0,keypressed=32 0:animationnormal,animate=35,movefore=5

;Walk Back
:state=1,varequal=Crouch 0,plrnotrunning,keypressed=17 0,keypressed=30 0,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -20,setvar=CFOTarget 0,animationreverse,animate=2,strafe=180,rotateiy=0
:state=1,varequal=Crouch 1,plrnotrunning,keypressed=17 0,keypressed=30 0,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -20,setvar=CFOTarget 0,animationreverse,animate=32,strafe=180,rotateiy=0

;Run Back
:state=1,varequal=Crouch 0,plrrunning,keypressed=17 0,keypressed=30 0,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -10,setvar=CFOTarget 0,animationreverse,animate=5,strafe=180,rotateiy=0
:state=1,varequal=Crouch 1,plrrunning,keypressed=17 0,keypressed=30 0,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -10,setvar=CFOTarget 0,animationreverse,animate=35,strafe=180,rotateiy=0

;Strafe Left
:state=1,varequal=Crouch 0,keypressed=17 0,keypressed=30 1,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=3,strafe=-90,rotateiy=0
:state=1,varequal=Crouch 1,keypressed=17 0,keypressed=30 1,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=33,strafe=-90,rotateiy=0

;Strafe Right
:state=1,varequal=Crouch 0,keypressed=17 0,keypressed=30 0,keypressed=31 0,keypressed=32 1:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=4,strafe=90,rotateiy=0
:state=1,varequal=Crouch 1,keypressed=17 0,keypressed=30 0,keypressed=31 0,keypressed=32 1:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=34,strafe=90,rotateiy=0

;Strafe Left + Strafe Right (Bug Fix)
:state=1,varequal=Crouch 0,keypressed=17 0,keypressed=30 1,keypressed=31 0,keypressed=32 1:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=1,strafe=0,rotateiy=0
:state=1,varequal=Crouch 1,keypressed=17 0,keypressed=30 1,keypressed=31 0,keypressed=32 1:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=31,strafe=0,rotateiy=0

;Walk\Run Forward + Walk\Run Back (Bug Fix)
:state=1,varequal=Crouch 0,keypressed=17 1,keypressed=30 0,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=1,strafe=0,rotateiy=0
:state=1,varequal=Crouch 1,keypressed=17 1,keypressed=30 0,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=31,strafe=0,rotateiy=0

;Walk\Run Forward + Walk\Run Back + Strafe Left + Strafe Right (Bug Fix)
:state=1,varequal=Crouch 0,keypressed=17 1,keypressed=30 1,keypressed=31 1,keypressed=32 1:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=1,strafe=0,rotateiy=0
:state=1,varequal=Crouch 1,keypressed=17 1,keypressed=30 1,keypressed=31 1,keypressed=32 1:setvar=CamDistTarget -25,setvar=CFOTarget 0,animationnormal,animate=31,strafe=0,rotateiy=0

;Strafe Left + Walk Forward
:state=1,varequal=Crouch 0,plrnotrunning,keypressed=17 1,keypressed=30 1,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=2,movefore=1,strafe=-45
:state=1,varequal=Crouch 1,plrnotrunning,keypressed=17 1,keypressed=30 1,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=32,movefore=1,strafe=-45

;Strafe Left + Run Forward
:state=1,varequal=Crouch 0,plrrunning,keypressed=17 1,keypressed=30 1,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=5,runfore=1,strafe=-45
:state=1,varequal=Crouch 1,plrrunning,keypressed=17 1,keypressed=30 1,keypressed=31 0,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=35,runfore=1,strafe=-45

;Strafe Right + Walk Forward
:state=1,varequal=Crouch 0,plrnotrunning,keypressed=17 1,keypressed=30 0,keypressed=31 0,keypressed=32 1:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=2,movefore=1,strafe=45
:state=1,varequal=Crouch 1,plrnotrunning,keypressed=17 1,keypressed=30 0,keypressed=31 0,keypressed=32 1:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=32,movefore=1,strafe=45

;Strafe Right + Run Forward
:state=1,varequal=Crouch 0,plrrunning,keypressed=17 1,keypressed=30 0,keypressed=31 0,keypressed=32 1:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=5,runfore=1,strafe=45
:state=1,varequal=Crouch 1,plrrunning,keypressed=17 1,keypressed=30 0,keypressed=31 0,keypressed=32 1:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=35,runfore=1,strafe=45

;Strafe Left + Walk Back
:state=1,varequal=Crouch 0,plrnotrunning,keypressed=17 0,keypressed=30 1,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=2,movefore=-1,strafe=45
:state=1,varequal=Crouch 1,plrnotrunning,keypressed=17 0,keypressed=30 1,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=32,movefore=-1,strafe=45

;Strafe Left + Run Back
:state=1,varequal=Crouch 0,plrrunning,keypressed=17 0,keypressed=30 1,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=5,runfore=-1,strafe=45
:state=1,varequal=Crouch 1,plrrunning,keypressed=17 0,keypressed=30 1,keypressed=31 1,keypressed=32 0:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=35,runfore=-1,strafe=45

;Strafe Right + Walk Back
:state=1,varequal=Crouch 0,plrnotrunning,keypressed=17 0,keypressed=30 0,keypressed=31 1,keypressed=32 1:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=2,movefore=-1,strafe=-45
:state=1,varequal=Crouch 1,plrnotrunning,keypressed=17 0,keypressed=30 0,keypressed=31 1,keypressed=32 1:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=32,movefore=-1,strafe=-45

;Strafe Right + Run Back
:state=1,varequal=Crouch 0,plrrunning,keypressed=17 0,keypressed=30 0,keypressed=31 1,keypressed=32 1:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=5,runfore=-1,strafe=-45
:state=1,varequal=Crouch 1,plrrunning,keypressed=17 0,keypressed=30 0,keypressed=31 1,keypressed=32 1:setvar=CamDistTarget -30,setvar=CFOTarget 0,animationnormal,animate=35,runfore=-1,strafe=-45
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 24th Nov 2016 11:59
arrojar entidad
You have to remember these are "puppet" scripts. The weapons are actually attached to the "player", not the character.
Using one script for any character would be hard, unless they all have to exact same animation.

I had to model my character with a weapon already attached using custom animation and scripts.

When I do bring up a weapon, I have it transparent so the players "weapon hud" is not visible. (only the cross hair)
But since my character has the weapon attached I can only use "one" weapon"
I'm thinking maybe, I could switch between 3rd person & 1st person when using weapons, maybe???
Might have a nice effect? Will try to work on some scripts.


My games never have bugs. They just develop random features..
Lots and lots of random features...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 24th Nov 2016 18:49
Worked on a few scripts and found it wasn't that hard to switch between 3rd person and 1st person view point.
made another quick video showing it, picked the first sword I found to kind of match my character.
It may be something that might work for you?
My games never have bugs. They just develop random features..
Lots and lots of random features...
arrojar entidad y que explote
9
Years of Service
User Offline
Joined: 3rd Jan 2015
Location:
Posted: 25th Nov 2016 03:56
Hi ncmako,Very good, I like it, I'm trying to use the useweapon and hasweapon commands, but I do not take them. In one of my many tests I get the character to use the weapon in the hand, but I do not know how I did it after so much modification. I know you can, I'm still trying. I'll keep in mind what you did to give options to my scripts. Thank you
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 25th Nov 2016 10:34
arrojar entidad
Quote: " I'm trying to use the useweapon and hasweapon commands"

Yes, I have also. It seems to attach the weapons, but mine are way off on correct position. They are
either on wrong side of character or in front? They don't attach to the "Firespot" bone at all?
Quote: " I'm trying to use the useweapon and hasweapon commands"

I have also tried them. The only commands I can use with them is to "shoot" the player
I can't seem to figure out how to shoot another NPC.
I'll work this weekend on some scripts and see what I can up with.
Till then, best
My games never have bugs. They just develop random features..
Lots and lots of random features...
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 27th Nov 2016 11:49
arrojar entidad
After some work on scripts I was able to attach weapons to a 3rd person character. But I have now run into another
problem. My characters seem to sink into the floor

Weapons attach nicely, but as you can see characters feet sink below floor? I'm sure it has to do with the script.
Will keep working on it...
My games never have bugs. They just develop random features..
Lots and lots of random features...
seppgirty
FPSC Developer
14
Years of Service
User Offline
Joined: 3rd Jul 2009
Location: pittsburgh, pa.
Posted: 27th Nov 2016 14:29
Nice job attaching the weapon NCMAKO. Interested to see how far you can get with 3rd person view.
gamer, lover, filmmaker
arrojar entidad y que explote
9
Years of Service
User Offline
Joined: 3rd Jan 2015
Location:
Posted: 27th Nov 2016 22:57 Edited at: 27th Nov 2016 22:58
ncmako
I like, I get to put the gun without it moving outside the character. In my case, I could do the same, but like the weapon is gone if we move very fast. Let's see what you think? I added melee attack. He still lacks the second look and can switch between multiple weapons.


https://www.youtube.com/watch?v=pbV-mcEkvEk
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 28th Nov 2016 09:13
arrojar entidad
After watching the video, your weapons appear to be working better than mine.
What are you using? The weapon HUD or the Vweap?
And No, I can't get mine to switch weapons also.
My games never have bugs. They just develop random features..
Lots and lots of random features...
arrojar entidad y que explote
9
Years of Service
User Offline
Joined: 3rd Jan 2015
Location:
Posted: 28th Nov 2016 14:44
ncmako

Use, hideweapon to hide the main weapon (the one that really shoots) and hasweapon to use a weapon already selected in the character, the same weapon is also selected in the player (green arrow)

The bad thing about this is that both the character and the player have to have the same weapon selected. If the player picks up another weapon, does not change in the character.

What I can not get, is that the character picks a weapon, without having to pre-define in the hasweapon of the configuration before.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 28th Nov 2016 17:55
arrojar entidad
Quote: "both the character and the player have to have the same weapon selected"

I am having the same problems it seems.
Quote: "If the player picks up another weapon, does not change in the character"

Me too
I did come across an old thread with some good 3rd person scripts.
Trying to get these to work.
https://forum.thegamecreators.com/thread/195008

My games never have bugs. They just develop random features..
Lots and lots of random features...
arrojar entidad y que explote
9
Years of Service
User Offline
Joined: 3rd Jan 2015
Location:
Posted: 28th Nov 2016 18:44
I tried with variables, using the script swapplrweapon (this script is to assign the route of a weapon, and thus make the character carry 2 or 3 weapons by default, but using weap, does not take very well hide and show. The appearance of the weapon or the character disappears.
ncmako
12
Years of Service
User Offline
Joined: 19th Feb 2012
Location: Hendersonville,NC
Posted: 29th Nov 2016 11:30
arrojar entidad
Quote: "using the script swapplrweapon"

Yes, all of these commands are for the player, not the NPC. I'm starting to hit a wall
here and making very little progress All my characters can hold a weapon (vweap)
but making them switch weapons I think is not possible?
My games never have bugs. They just develop random features..
Lots and lots of random features...

Login to post a reply

Server time is: 2024-04-24 14:34:06
Your offset time is: 2024-04-24 14:34:06