FAQFAQ    Board RulesBoard Rules    SearchSearch    LotteryLottery    RouletteRoulette    UsergroupsUsergroups
     RegisterRegister  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Shop    Log inLog in 
View posts since last visitView your postsView unanswered posts

Linking to hand

 
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding
View previous topic :: View next topic  
Author Message
mammix

Junior Member
Junior Member


Joined: 20 Sep 2014
Posts: 97
Location: Lublin, Poland
3546 Bank Notes
Items

PostPosted: Wed Feb 03, 2021 10:46 pm    Post subject: Linking to hand Reply with quote

OK, it's time to ask about the problem that I faced during all of my mod (apart from one mission, which I guess worked as a miracle).
So: why don't items get linked to hand no matter what I do?

In this case, I want Paulie to appear as he talks on a phone, so he needs a handle in his right hand.
I create actor for Paulie.
I create an item for the handle. In MWE I put as the parent "Paulie.r_hand". I place it initially so it's in Paulie's right hand.
In Paulie's script I put "HUMAN_LINKTOHAND 5,0,hand,right", where 5 is frame of the handle, 0 is the actor for Paulie.
And then the handle stays in one place, no matter if Paulie is supposed to just move his right arm, or walk away.

It happens to me with pretty much every item in the game, no matter what I try to do - that's why I don't put, for example, cigarettes, just use the animation. Only in the 1st mission a bum can be seen drinking from a bottle, which moves with his arm - and I repeat the same solution here.

Any ideas? Thanks in advance!
Back to top
View user's profile Send private message
flovivi

Junior Member
Junior Member


Joined: 22 Dec 2014
Posts: 67

329 Bank Notes
Items

PostPosted: Fri Feb 05, 2021 10:51 am    Post subject: Linking to hand Reply with quote

I never used the link to hand command.

Basically just put the object into Paulie's hand and set his hand as a parent, as you already did.

Then, you should simply hide it. And when you need it to appear, unhide it. And hide it again after the animation.

I made a script that let's Tommy drink a bottle of beer for a mod I once started but never finished.

The script, once the player presses the action button, hides the bottle that is standing on the kitchen table (frm_seton 1, 0) and unhides the bottle that has been always in Tommy's hands frm_seton 2, 1.

After 5 seconds, when Tommy's hand with the bottle reaches the table again, the bottle from his hand disappears (it simple will be set to hidden) and the bottle on the table appears again.

So I used two bottles. One that always stays on the table, and one that is always in Tommy's hand.


findframe 1, "bottle_on_table"
findframe 2, "hand_in_bottle"

label 1
detector_waitforuse 6
player_lockcontrols 1
actor_setplacement 0, 0
person_playanim 0, "x bar stojak piti01.i3d", 0
wait 900
frm_seton 1, 0
frm_seton 2, 1
wait 5000
frm_seton 1, 1
frm_seton 2, 0
wait 2100
player_lockcontrols 0
person_stopanim 0
goto 1

remember to hide the bottle at the beginning of the game: frm_seton 2, 0

I hope this helps. With this method, you could also play the phone animation, and as soon as Paulie's hand reach the handle, hide the handle that is on the phone and unhide the handle that Paulie holds in his hand.
Back to top
View user's profile Send private message
mammix

Junior Member
Junior Member


Joined: 20 Sep 2014
Posts: 97
Location: Lublin, Poland
3546 Bank Notes
Items

PostPosted: Fri Feb 05, 2021 12:48 pm    Post subject: Linking to hand Reply with quote

Thanks for the reply, but I did that already, and did not work as well.
I think my version must be cursed or something...
Back to top
View user's profile Send private message
flovivi

Junior Member
Junior Member


Joined: 22 Dec 2014
Posts: 67

329 Bank Notes
Items

PostPosted: Fri Feb 05, 2021 4:41 pm    Post subject: Linking to hand Reply with quote

You could play the mission on the boat. I think they used the technique I mentioned there. Actually I copy pasted the script along with the positions and so on from there. Would be interesting to know if it works in that mission. Otherwise the ghost of Sam is somewhere in your game files Shocked
Back to top
View user's profile Send private message
Melhior

Junior Member
Junior Member


Joined: 25 Dec 2014
Posts: 52
Location: Russian
594 Bank Notes
Items

PostPosted: Mon Feb 08, 2021 10:32 pm    Post subject: Re: Linking to hand Reply with quote

mammix wrote:
In Paulie's script I put "HUMAN_LINKTOHAND 5,0,hand,right", where 5 is frame of the handle, 0 is the actor for Paulie.

HUMAN_LINKTOHAND 5,0,right
That's how you spell it.
Back to top
View user's profile Send private message
mammix

Junior Member
Junior Member


Joined: 20 Sep 2014
Posts: 97
Location: Lublin, Poland
3546 Bank Notes
Items

PostPosted: Sat Feb 13, 2021 10:21 am    Post subject: Linking to hand Reply with quote

Still doesn't work.
Thanks for help, though.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Generation Time: 0.019 | Queries: 18