Jump to content

Howto create outdoor bench press


padrote1

Recommended Posts

I'm not sure if this should be in mission coding or mapping, but since I found entries for it in the main.scm I'll ask here. I'd like to put a working bench press outside CJ's house, which he could use like the bench at a gym. I haven't had much luck finding how to do it while searching here, but I've seen where people have released safehouses with gyms inside.

 

Is there an easy function call to create a bench press object, or would I have to add it like any other 3d model and then attach things to it manually to make it functional (ie, writing a script to display the menu for choice of how much weight, how many more reps can be done, etc.)?

 

BTW, thanks to the community for all the tutorials on how to spawn vehicles and weapons, the tools to mess around with the game, etc. I hope to get up to speed so I can start contributing things here also.

Link to comment
Share on other sites

The menu and animations will be taken care of automatically by the code. The easiest way to do it is to use the map files to place one where you want. I'm no mapper, so I won't pretend to know exactly how. For that matter, all benches in the game are in interiors. Don't know if an object can ONLY exist in interiors (or specific ones), but something to maybe watch for.
Link to comment
Share on other sites

Craig Kostelecky
For that matter, all benches in the game are in interiors. Don't know if an object can ONLY exist in interiors (or specific ones), but something to maybe watch for.

There is an outdoor gym in the beach of south Los Santos.

Link to comment
Share on other sites

As Dem said, you'll need to place these objects through the IPL. Easiest way to do this is add to an ipl of your choice.

 

The fastest way you'll accomplish it is:

 

1: Map Viewer, get the name of the models you want to put places.

2: CTRL+F search in the IDEs for the names of those object (wonder if they'd e in the dynamic ides???)

3: get the coords for where you want them

4 copy the entries from other IPLs and change the coords only, to your new ones of course wink.gif

 

 

Now, Kam has released a Max script for mapping, and I must say he's done it again! This may make it ALOT easier to accomplish. But learn notepadding in GTA first dammit! lol

Link to comment
Share on other sites

As Dem said, you'll need to place these objects through the IPL. Easiest way to do this is add to an ipl of your choice.

 

The fastest way you'll accomplish it is:

 

1: Map Viewer, get the name of the models you want to put places.

2: CTRL+F search in the IDEs for the names of those object (wonder if they'd e in the dynamic ides???)

3: get the coords for where you want them

4 copy the entries from other IPLs and change the coords only, to your new ones of course wink.gif

 

 

Now, Kam has released a Max script for mapping, and I must say he's done it again! This may make it ALOT easier to accomplish. But learn notepadding in GTA first dammit! lol

1. OK.... I found out the dff is gym_bench1.dff, the txd is genintint_gym.txt, and the object id is 2629 (the bench on the beach)

2. I grepped the maps directory, with gym_bench1 as the search string and turned up this entry in interior/props2.ide

 

2629, gym_bench1, genintint_gym, 20, 0

 

 

I'm not sure what the 20 and 0 mean, as I haven't found any documentation for San Andreas IDE files

 

3. The Coords I want are 2511 -1687 13.57013 45.0 degrees

 

4. I haven't found this listed in any IPL file, hence I have no idea what flags to set

 

I added the following line to LA/LAe2.ipl

 

2629, gym_bench1, 0, 2511.0 -1687.0 12.57013, 0, 0, 0, 0, -1

 

 

and this is the result!

 

user posted imageuser posted image

 

Thanks a million for breaking it down for me!

 

I dropped it down a unit because it was about a meter off the ground when I used 13.57013 as the z-coordinate (13.57 was the number SAPlaceMapper returned as the z-coord when I was standing in the place I wanted to put the bench... I'm guessing it uses CJ's chest-height as the z-value returned).

 

I wanted to rotate it 45 degrees about the Z-axis, so that the bench is roughly paralell to the driveway, but substituting 45.0 for RotationZ resulted in the thing not showing up.

 

ID#, DFF Name, Interior#, X-Coord, Y-Coord, Z-Coord, RotationX, RotationY, RotationZ, RotationR, Flags

 

Am I missing something? Can I set a rotation for any object in the IPL file like I can when I spawn a car in the main.scm?

Link to comment
Share on other sites

I dropped it down a unit because it was about a meter off the ground when I used 13.57013 as the z-coordinate (13.57 was the number SAPlaceMapper returned as the z-coord when I was standing in the place I wanted to put the bench... I'm guessing it uses CJ's chest-height as the z-value returned).

Yeah, get_player returns chest value while put_player refers to feet. The difference is about 1.01.

Link to comment
Share on other sites

yes, awesome it worked biggrin.gif

 

 

2629, gym_bench1, 0, 2511.0 -1687.0 12.57013, 0, 0, 0.382683, 0.92388, -1

 

 

Above is rotation 45 degrees on z axis wink.gif

 

www.steve-m.com for the rotation calculator (what i used for the top code). You had the line figured right, except the format of the values. tounge.gif

 

it's a 0-to-1 thing. "am I not turned(z)? 0, 0, 0, 1, -1" "Am I turned 180 degrees(z)? 0, 0, 1, 0, -1" "Am I turned 90 degrees(z)? 0,0, 0.707107, 0.707107, -1"

 

You'll see what I mean when you get that great tool wink.gif

 

Say could you teach me to grep? I assume that's batch searching text in a directory? What would be extremely useful for finding some objects I'll need to keep around when I finanlly finalize cleaning out my SA installation.

 

PS IDE doc, as well as many more handy maps files docs, are now re-stickied in the maps section in a post by Ashdexx called Directory. wink.gif

Edited by dertyjerzian
Link to comment
Share on other sites

 

yes, awesome it worked biggrin.gif

 

 

2629, gym_bench1, 0, 2511.0 -1687.0 12.57013, 0, 0, 0.382683, 0.92388, -1

 

 

Above is rotation 45 degrees on z axis wink.gif

 

www.steve-m.com for the rotation calculator (what i used for the top code). You had the line figured right, except the format of the values. tounge.gif

 

it's a 0-to-1 thing. "am I not turned(z)? 0, 0, 0, 1, -1" "Am I turned 180 degrees(z)? 0, 0, 1, 0, -1" "Am I turned 90 degrees(z)? 0,0, 0.707107, 0.707107, -1"

 

You'll see what I mean when you get that great tool wink.gif

 

Say could you teach me to grep? I assume that's batch searching text in a directory? What would be extremely useful for finding some objects I'll need to keep around when I finanlly finalize cleaning out my SA installation.

 

PS IDE doc, as well as many more handy maps files docs, are now re-stickied in the maps section in a post by Ashdexx called Directory. wink.gif

Oh, ok... rotation is done with quaternions. Makes sense since a quaternion is 4 components vs. 9 for a rotation matrix.

 

grep is one of the most useful UNIX tools I've ever used. Any UNIX or linux distro will have it, and it's easy to write a bash script to log all occurances of any text pattern. It's also useful to recover deleted text files on an unmounted partition by reading the whole partition as a file. If you ever delete a really important text file you can shut your computer down immediately, pop in a KNOPPIX CD, and have grep print out the text for you since all you did was delete the file pointer and not the actual data.

 

There's a windows version that makes it very easy to use for finding which files contain a name (link), that will print the filename as well as the line the text occurs in.

 

For example, say I have this grep.exe installed in some directory in my path (say \windows\system32) and I want to search for bench in all subdirectories from the maps directory... ie, I'm in maps

 

 

grep -S bench *

 

 

returns

 

 

.\interior\props2.ide:2629, gym_bench1, genintint_gym, 20, 0.\LA\LAe2.ipl:2629, gym_bench1, 0, 2511.0 -1687.0 12.57013, 0, 0, 0.9238795, 0.3826834, -1.\generic\dynamic.ide:1256, Stonebench1, benchm, 50, 128.\generic\dynamic.ide:1280, parkbench1, benches_cj, 50, 128.\generic\dynamic.ide:1281, parktable1, benches, 47, 2097280.\interior\int_LA.ide:14401, bench1, DR_GSnew, 75, 0.\interior\props2.ide:2628, gym_bench2, genintint_gym, 20, 0.\interior\props2.ide:2629, gym_bench1, genintint_gym, 20, 0

 

 

* tells it to search every file, -S tells it to recursively go through subdirectories. To make a logfile redirect the stdout to a file.

 

 

grep -S bench * > bench.log

 

Edited by padrote1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.