Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tutorial: How to Implement a Sitting Script
#1
In this short tutorial, I'll teach you how to implement a script that allows you to have Tommy sit down in any chair you want. Technically, this isn't a mod - mainly because I don't have time to implement the script for every chair in the entire game. Therefore, I decided to provide you with the script and let you implement it yourselves for the chairs you want Tommy to be able to sit down in.

Start by opening up BScript View 4 (use version 4, not 6) and make sure you run as Administrator. Now, hit Enter > Other and name your script Sitdown. Leave it at that for now and go into Editor. In Editor, seek out the chair you want Tommy to be able to sit down in. Place your script near the chair - yet not at it quite yet. Now, hit Enter Model and name it Sitdown2. Leave the parent at Primary Sector and let the model be nothing.i3d. Next, place Sitdown2 right at the chair (make it just barely be above the ground and have the pointy thing face away from the chair). Next, place Sitdown right at the chair as well (at about chest height and with the pointy thing facing towards the direction from which the player will approach the chair) and save.

Go back into BSV and replace the '/////' in your Sitdown script with:

dim_act 5
dim_flt 5
dim_frm 5

findactor 0,"Tommy"
findframe 1,"Sitdown2"

label 1
detector_waitforuse
player_lockcontrols 1
zatmyse 1
actor_setplacement 0, 1
person_playanim 0,"Seznormal.i3d"
zatmyse 0
player_lockcontrols 0
goto 1

Save the script and you're done! You'll be able to use the script an infinite amount of times within a single game session and you can use the script for any chair, couch or stool you like. You may also change the Seznormal.i3d animation to another sitting animation of your liking.

Enjoy.
#2
Thank you very much, i was looking for this in my mod, maybe i can delay the release and add it Big Grin
#3
Could you attach smoking script as well and tell how to execute it ? Smile
#4
Well, if you want to use a smoking script outside of a cutscene - you'll have to hold perfectly still as to not cause Tommy to return to the normal playing state, which is why I don't really recommend doing that. If you want a smoking script to use in say Freeride, I'd recommend having one that plays for a certain amount of time. This can easily be done, but you'll need to decide as to whether you want it to play for a certain amount of time outside of a cutscene or if you want it for a game sequence during a dialogue or something like that.
#5
All you'd need to do to make Tommy sit still during an animation is "player_lockcontrols 1"
#6
Yeah, I know - but then you need to decide how long you want him to stand a-smokin'.
#7
I want to have a separate smoking script to use in Free Ride.

Could you take it down here ?
#8
LassiterSeries69" post=11339":2xrqu7yb Wrote:Yeah, I know - but then you need to decide how long you want him to stand a-smokin'.

You could implement a "ctrl_read" script so that you could press the action button whenever you felt like it and he would stop and get up again.
#9
Then he'll start smoking as soon as he's not using any controls.


Forum Jump:


Users browsing this thread: 1 Guest(s)