Gamestudio Links
Zorro Links
Newest Posts
Zorro Trader GPT
by TipmyPip. 12/04/23 11:34
Newbie Questions
by AndrewAMD. 12/04/23 11:14
Square root rule
by Smallz. 12/02/23 09:15
RTest not found error
by TipmyPip. 12/01/23 21:43
neural function for Python to [Train]
by TipmyPip. 12/01/23 14:47
Xor Memory Problem.
by TipmyPip. 11/28/23 14:23
Training with command line parameters
by TipmyPip. 11/26/23 08:42
Combine USD & BTC Pairs In Asset Loop
by TipmyPip. 11/26/23 08:30
AUM Magazine
Latest Screens
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Who's Online Now
2 registered members (TipmyPip, izorro), 556 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
fairtrader, hus, Vurtis, Harry5, KelvinC
19019 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Attaching a moddel #105578
01/06/07 15:17
01/06/07 15:17
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline OP

Expert
aztec  Offline OP

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
Hey there how can I attach a moddel
like a gun to an arm I tried the AUR Tutorial and the one Geogre wrote in one of the Aums but it didnt work
can someone give me an good example?
Regards
Aztec


Visit:
schwenkschuster-design.de
Re: Attaching a moddel [Re: aztec] #105579
01/06/07 15:51
01/06/07 15:51
Joined: Sep 2003
Posts: 648
Switzerland
snake67 Offline
User
snake67  Offline
User

Joined: Sep 2003
Posts: 648
Switzerland
Its very simple. I know at least 2 ways.

1. Attaching in WED rightklick, "properties...", "attached", "open" -> entity (must be in level already). Then select the first script below for the attached entity.

2. Creating an entity by script in second code:

action carry_weapon
{
my.passable=on; // weapons must be passable, otherwise collision...
if(my.parent) {you=my.parent;} // for the case of attachment in WED
while(you)
{
vec_set(my.x, you.x);
vec_set(my.pan, you.pan);
my.frame=you.frame; // if animation is required
my.nextframe=you.nextframe; // if animation is required, importand!
wait(1);
}
ent_remove(me);
}


action actor_with_weapon
{
ent_create("weapon_x.mdl", my.x, carry_weapon);
...


Re: Attaching a moddel [Re: snake67] #105580
01/06/07 16:40
01/06/07 16:40
Joined: Apr 2005
Posts: 2,332
Germany, BaWü
aztec Offline OP

Expert
aztec  Offline OP

Expert

Joined: Apr 2005
Posts: 2,332
Germany, BaWü
thx but musnt be action carry weapon be function cary weapon?
thx anyway
Regards
Aztec

EDIT:
hm I dont know the weapon moves with the enemy but between the legs
and i had to delete the nextframe he didnt know that one

isnt there an other way?

Regards
Aztec

Last edited by aztec; 01/06/07 16:53.

Visit:
schwenkschuster-design.de
Re: Attaching a moddel [Re: aztec] #105581
01/06/07 17:55
01/06/07 17:55
Joined: Mar 2006
Posts: 752
Portugal
demiGod Offline
User
demiGod  Offline
User

Joined: Mar 2006
Posts: 752
Portugal
Yeah, just use vertex attach and the function vec_for_vertex. Then you can define a vertex in the hand where de gun will be attached and move with the player. Do a search in the forum for "vattach".

Re: Attaching a moddel [Re: aztec] #105582
01/06/07 18:26
01/06/07 18:26
Joined: Sep 2003
Posts: 648
Switzerland
snake67 Offline
User
snake67  Offline
User

Joined: Sep 2003
Posts: 648
Switzerland
May... I called it action because there are 2 solutions. The first need action.

Vertex attach is another. But things get complicated with animations. Actors do not hold their guns alwais vertically so you will need at least 2 better 3 vertices to compute the right angle. If your edition supports bones you can use vec_for_bone and ang_for_bone. All bones to wich weapons should be attached could be called "weapon", so you dont need to store different vertex numbers.


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