Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 20:05
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, kzhao), 901 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
how can I set postion of gun for a first person shooter #315783
03/19/10 00:11
03/19/10 00:11
Joined: Dec 2009
Posts: 71
N
ncc1701d Offline OP
Junior Member
ncc1701d  Offline OP
Junior Member
N

Joined: Dec 2009
Posts: 71
Below I am trying to create a gun view for use in a first person shooter. From what I understand after setting up this view I have to offset the gun or camera a little bit off to one side. I was wondering how to do that? What I have below puts me directly behind the gun. I think I have to offset the gun now or camera. so the gun shoots to the center of the screen butt gun looks off to the side.


VIEW* gun_view =

{
type = "pistol.mdl";
layer = 2;
gun.x = 34;
gun.y = 0;
gun.z = 0;


flags = SHOW;

view = camera;

}
Am I positioning wrong here? Its not doing anything.
I am looking at a version 6 gamestudio tut so maybe I am wrong in my approach?
Thanks for any help you can give. If I type in gun.x =34; after pressing the tab key it moves but including it here it doesnt move.

Last edited by ncc1701d; 03/19/10 00:33.
Re: how can I set postion of gun for a first person shooter [Re: ncc1701d] #315787
03/19/10 01:05
03/19/10 01:05
Joined: Jul 2009
Posts: 80
Area 51
F
fangedscorpion Offline
Junior Member
fangedscorpion  Offline
Junior Member
F

Joined: Jul 2009
Posts: 80
Area 51
I don't think that you need the view = camera code in there because the flags = SHOW already defines the gun as being seen by the camera. I might be wrong on that though. How have you set the gun entity up? I would try using the pos_x and pos_y code lines to move the entity around. I tried out using a defined entity instead of a view entity for one of the models in my game before.

Try creating the entity this way:

ENTITY* gun =
{
type = "pistol.mdl";
layer = 2;
x = 34; // play around with these values. These values determine how much the entity is put ahead, above, below, right
or left of the view. To put the gun ahead of the view use a + x value. Opposite for behind the view
-y = to the left. +y = to the right. -z = below. +z = above.
y = 0;
z = 0;

flags = SHOW;
}

Hope this helps. I found this under the entities section in the manual. I also knew most of the code from previous experience.
If you want to find the page in the manual for more detail, go to the search tab in the gamestudio manual and type in "entities" and choose the 4th result ( the title is entities and there should not be any pictures of a minotaur on the page)

-fanged scorpion


"Pow! You are dead! Not big suprise!" -Heavy
Re: how can I set postion of gun for a first person shooter [Re: fangedscorpion] #315797
03/19/10 02:44
03/19/10 02:44
Joined: Dec 2009
Posts: 71
N
ncc1701d Offline OP
Junior Member
ncc1701d  Offline OP
Junior Member
N

Joined: Dec 2009
Posts: 71
ok thanks. I should have been using flags2.

Re: how can I set postion of gun for a first person shooter [Re: ncc1701d] #315911
03/19/10 23:59
03/19/10 23:59
Joined: Dec 2008
Posts: 1,660
North America
Redeemer Offline
Serious User
Redeemer  Offline
Serious User

Joined: Dec 2008
Posts: 1,660
North America
I think I know what you're doing wrong. Take a look at this code:

Code:
gun.x = 34;
gun.y = 0;
gun.z = 0;



This should be:

Code:
x = 34;
y = 0;
z = 0;



Tell me if that works.


Eats commas for breakfast.

Play Barony: Cursed Edition!

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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