Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/20/24 01:28
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, Ayumi), 838 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Enemies to hold guns #429601
09/14/13 22:44
09/14/13 22:44
Joined: Aug 2013
Posts: 101
M
mschoenhals Offline OP
Member
mschoenhals  Offline OP
Member
M

Joined: Aug 2013
Posts: 101
I'm using AUM's shooter code and I've purchased some example characters to work with while I'm learning about this program. Problem I'm having is that the character's all come with guns that are separate. I can add the gun in MED by using the merge command but I can't get that to happen in WED so enemies hold the weapon. Any ideas?

Re: Enemies to hold guns [Re: mschoenhals] #429602
09/14/13 22:49
09/14/13 22:49
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
In MED:
If your models have bones.
Open your player model and merge the gun model ( file/merge ).
Select a bone and switch into "Apply Vertices Mode". Select the vertices of your gun and press the "Apply vertices" button ( framerange should be setup to all frames ). If you want to do it by script this could look like this
Code:
void hold_gun(){ //me = a gun, you = player
..
   while (me && you){
      VECTOR _a, _p;
      vec_for_bone (_p, you, "BoneName");//xyz pos of bone
      ang_for_bone (_a, you, "BoneName");//pan,tilt,roll of bone
      vec_set (my.x, _p.x); //set xyz
      vec_set (my.pan, _a); //set pan...
      wait (1);
   }
..
}



Cheers

Last edited by rayp; 09/14/13 22:57.

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Enemies to hold guns [Re: rayp] #429604
09/14/13 23:04
09/14/13 23:04
Joined: Aug 2013
Posts: 101
M
mschoenhals Offline OP
Member
mschoenhals  Offline OP
Member
M

Joined: Aug 2013
Posts: 101
Thank you for your response. What if the models don't have bones? They do have animated actions but there's no visible bones.

Re: Enemies to hold guns [Re: mschoenhals] #429605
09/14/13 23:07
09/14/13 23:07
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Then the only thing i can imagine right now would be a workaround with maybe
Code:
vec_for_vertex


Except of that i have no idea sry.

edit: I assume u switched into "Bones" Mode before ?

Last edited by rayp; 09/15/13 00:01. Reason: see edit

Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Enemies to hold guns [Re: rayp] #429606
09/15/13 00:45
09/15/13 00:45
Joined: Aug 2013
Posts: 101
M
mschoenhals Offline OP
Member
mschoenhals  Offline OP
Member
M

Joined: Aug 2013
Posts: 101
Yup, just double checked. Is it common for characters not to have bones? I do a lot of 3D Animation - most of which is done with bones.

Re: Enemies to hold guns [Re: mschoenhals] #429607
09/15/13 00:51
09/15/13 00:51
Joined: Jul 2008
Posts: 2,107
Germany
rayp Offline

X
rayp  Offline

X

Joined: Jul 2008
Posts: 2,107
Germany
Every model i have bought has bones ( without i would not pay for it ). Its always better to have bones cause removing them is done in a second. And with bones ure able to use nice stuff like
Code:
ent_animatefrom



Acknex umgibt uns...zwischen Dir, mir, dem Stein dort...
"Hey Griswold ... where u gonna put a tree that big ?"
1998 i married my loved wife ... Sheeva from Mortal Kombat, not Evil-Lyn as might have been expected
rayp.flags |= UNTOUCHABLE;
Re: Enemies to hold guns [Re: rayp] #429632
09/15/13 18:16
09/15/13 18:16
Joined: Aug 2008
Posts: 408
mi usa
sadsack Offline
Senior Member
sadsack  Offline
Senior Member

Joined: Aug 2008
Posts: 408
mi usa
bones are good, no bone no buy


I have A7 Commercial .............. Now I just need to learn how to use it

Re: Enemies to hold guns [Re: rayp] #429837
09/19/13 09:14
09/19/13 09:14
Joined: Jan 2006
Posts: 968
EpsiloN Offline
User
EpsiloN  Offline
User

Joined: Jan 2006
Posts: 968
Originally Posted By: rayp
Then the only thing i can imagine right now would be a workaround with maybe
Code:
vec_for_vertex




Use vec_for_vertex twice for 2 vertices, then substract the two vectors (vec_sub) to get the direction from one vector to another and align the gun using the resulting vector.

Code:
vec_for_vertex(tmppos1.x,tmp_parent,vertnum);
	vec_set(my.x,tmppos1.x);

	vec_for_vertex(tmppos2.x,tmp_parent,vert2num);
	vec_sub(tmppos2.x,my.x);
	vec_to_angle(my.pan,tmppos2.x);



Thats an example of one of my old projects, I modified the vector/variable names so you can understand what is what.
After the vec_to_angle you might have to add to pan or tilt to get the right alignment of the gun (depends of MED).

PS.: Dont be afraid to use vec_for_vertex and no-bones models for start, you can later change them with bone models without much coding.(If you make it clean)


Extensive Multiplayer tutorial:
http://mesetts.com/index.php?page=201

Moderated by  HeelX, rvL_eXile 

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