Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (dr_panther, 7th_zorro), 1,203 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
camera += gun #150838
08/28/07 19:46
08/28/07 19:46
Joined: Aug 2007
Posts: 27
M
Memphis Offline OP
Newbie
Memphis  Offline OP
Newbie
M

Joined: Aug 2007
Posts: 27
hi this maybe has been brought up in other threads, but i cant find anything useful....

i've been working on a small FPS game, i've run into a problem.... character += camera + gun

ok so thers like 10+ guns, i've played about with
Code:
vec_for_vertex(temp, player, 870);


but it just doesnt look good no matter what i do, i'm trying to make it look like its actually in the players hand, as it will also in the future be multiplayer.

ok so my second option was to create the gun with model of arms... then hide the character + gun from camera view, and show these arms+gun as local entity in the camera, but .genius only supports 1 item if i am correct...

if anyone can give me some sugestions, snippets to examine.. or any other form of help, would be appreciated.

thanks in advance...


Meka][Meka || TeamElite Owner Meka-Meka Programmers
Re: camera += gun [Re: Memphis] #150839
08/28/07 20:00
08/28/07 20:00
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
if you want to have the model as a typical FPS, just write:
Code:
vec_set(weapon.x,camera.x);
vec_set(temp,vector(10,2,-5));//play with it
vec_rotate(temp,player.pan);
vec_add(weapon.x,temp);
vec_set(weapon.pan,player.pan);



enjoy

Re: camera += gun [Re: Scorpion] #150840
08/28/07 20:12
08/28/07 20:12
Joined: Aug 2007
Posts: 27
M
Memphis Offline OP
Newbie
Memphis  Offline OP
Newbie
M

Joined: Aug 2007
Posts: 27
thanks for your response scorpion

ok this kinda would work, if there was no player arm animations, but if the players arm moves, the gun wont position itself to the hand... which i solved using the vec_for_vertex, but still this doesnt look so nice, doesnt actually look like its being held....

take here > http://www.jxp.ca/media/speciaux/unreal5lf7gk.jpg < for example. notice the opponent has hold of a gun, even when the model is animated the gun is still held in its hand. regardless of also weapon switching.... im looking for something in this sort of direction....


Meka][Meka || TeamElite Owner Meka-Meka Programmers
Re: camera += gun [Re: Memphis] #150841
08/28/07 21:29
08/28/07 21:29
Joined: Mar 2003
Posts: 4,264
Wellington
Nems Offline

.
Nems  Offline

.

Joined: Mar 2003
Posts: 4,264
Wellington
The easiest (is that a real word?... well it is now!)way is to animate the weapon(each one) with the model then save the file as the 'gun', delete the player, resave without changing the weapons position then use that 'gun' to attach to the player model.
add to the 'gun' scipt, my.Frame = your.frame; my.next_frame = your.next_frame; and the weapon will confrom to the animations as it should do.

Re: camera += gun [Re: Nems] #150842
08/29/07 02:09
08/29/07 02:09
Joined: Mar 2007
Posts: 75
M
Metal_Man Offline
Junior Member
Metal_Man  Offline
Junior Member
M

Joined: Mar 2007
Posts: 75
if you are using vec_for_vertex, are you using other vertecies to determine the rotation of the weapon? you would need two extra verticies to determine the rotation. one to point it in the right direction and another to prevent it from spinning oddly.

this is even easier than animating each weapon because it means that less animations are requiured, one set of animations in the hands would suffice. Also, you wouldn't have to change animations of several models to change or add new animations.

to take care of weapon switching, edit the model in MED to move the whole thing such that the center of the model is at the position you wish for it to be held at.

Re: camera += gun [Re: Metal_Man] #150843
08/29/07 08:53
08/29/07 08:53
Joined: Aug 2007
Posts: 27
M
Memphis Offline OP
Newbie
Memphis  Offline OP
Newbie
M

Joined: Aug 2007
Posts: 27
hi, thanks for your replies... ok

Nemisis : the problem with this solution is, if there is say 20 models and 20 different guns, thats alot of animation lol.... but thanks it is one option...

Metal_Man : yes i calculate the movement of the player to position the gun, but still it jus doesnt look right, it seems you are able to see through the player and see the gun, even tho the player is in front of the gun, very odd....

i guess to model the arms with each gun, probably is best way around this...

but is it possible to hide the player and a model of the gun locally, so multiplayer can see the vec_for_vertex method, and the player can see the arms with gun model ?

thanks in advance.


Meka][Meka || TeamElite Owner Meka-Meka Programmers
Re: camera += gun [Re: Memphis] #150844
08/29/07 12:24
08/29/07 12:24
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
yeah...there is something as ent_reatelocal....

to add to a vertex and rotate it by a second vertex is also really easy:

Code:
vec_for_vertex(temp,player,1234);
vec_set(weapon.x,temp);
vec_for_vertex(target,player,1235);
vec_sub(target,temp);//Get the direction
vec_to_angle(weapon.pan,target);



Re: camera += gun [Re: Scorpion] #150845
08/29/07 16:19
08/29/07 16:19
Joined: Aug 2007
Posts: 27
M
Memphis Offline OP
Newbie
Memphis  Offline OP
Newbie
M

Joined: Aug 2007
Posts: 27
hi thanks, yep i know of ent_createlocal, which is fine for creating the arms... but for camera hiding the player and gun ie like

camera.genius = player

i need also todo this with the gun model

thanks.


Meka][Meka || TeamElite Owner Meka-Meka Programmers
Re: camera += gun [Re: Memphis] #150846
08/29/07 17:14
08/29/07 17:14
Joined: Mar 2007
Posts: 75
M
Metal_Man Offline
Junior Member
Metal_Man  Offline
Junior Member
M

Joined: Mar 2007
Posts: 75
seeing the gun through another object is a skin problem. try turning off the alpha setting for the player's skin

Re: camera += gun [Re: Metal_Man] #150847
08/29/07 19:15
08/29/07 19:15
Joined: Aug 2007
Posts: 27
M
Memphis Offline OP
Newbie
Memphis  Offline OP
Newbie
M

Joined: Aug 2007
Posts: 27
hi, ok i couldnt find anything with the alpha settings that would of affects this, ok i've made a quick example of what is happening, i havent positioned gun to hand, ive moved the gun in front of player and this is what happens:






Meka][Meka || TeamElite Owner Meka-Meka Programmers
Page 1 of 2 1 2

Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1