Jump to content
Sign in to follow this  
Symbiot

Replace object and keep it's position. It's posbl?

Recommended Posts

I try to replace some of objects on my map to the same objects but with changed model and texture path.

If i do TOOLS/Replace object it works, i see my obect in Buldozer, but i can't keep it's position.

The problem is - i have a few hundreds of this objects on my map and i'd like to keep it as it was with old model.

Some ideas how to do it ?

Share this post


Link to post
Share on other sites

Hex edit the .pew to refer to the new model/texture paths should work.

Share this post


Link to post
Share on other sites
Hex edit the .pew to refer to the new model/texture paths should work.

I've already did it for model and it works, but not for .pew dunno why...

Share this post


Link to post
Share on other sites
but not for .pew dunno why...

because each 'instance' of a object 'template' in a .pew has the object templates name embeded in it AND the 'type id'.

Also, although the name is a 'null-terminated' asciiz string the size of the string is also stored in the 'instance'.

So simply hex editing a name change is insufficient to point a existing instance at a new template.

If you wanted to point say a 100 'instances' at a new 'template' - I'm not sure if the built in V3 script allows for this... haven't ever delved into that much (sorry Edge).

If you wanted to 'hex' it then you'd have to change the name & change the size value of the string as well. Then you'd have to also point them at the 'new' template id.

essentially if you don't know anything about this sort of stuff you will have real difficulty.

I suggest you pm Edge with a brief question something along the lines of...

Is it possible using the V3 scripting to re-allocate a certain group of object instances of one type of object template to another type of object template AND still keep the position, orientation and scale from the the original object template?

Another possible solution might be to do the following...

0. Make a backup copy of your .pew !!!!!

1. Run the 'ExportObject.vis' script.

- Select only the object you want to 'replace'.

- Make sure you have z-absolute instead of z-relative ticked.

- Make sure you have Orientation ticked.

2. Create a new object template in your .pew pointing at the 'new' model. Note the name of this new template.

3. Open the exported objects text file and replace the old object name with the new object name.

4. Make a copy of the ImportObjects.vis script and call it ImportObjectsAbsolute.vis.

- Edit this script text file to set the 'absolute' position NOT the relative position.

5. Select all the old objects in your .pew and delete them.

6. Run the ImportObjectAbsolute.vis script and import the modified text file.

Share this post


Link to post
Share on other sites

Sy, this is a bit OT, but how do you read and understand the data in .pew/wrp files? To me it looks like jibberish machine code. Do you decompile it in any way or what? I'm really curious about this.

Share this post


Link to post
Share on other sites

I DID it !!!!

I have HEXed .pew and it works. The easiest way to keep it work - is to have the same name length if you change something...

For ex - ca\plants\data\briza2_2.rvmat - 29 symbols

So you need to have the path like - ca\fseden\vegetation\b2.rvmat - 29 symbols

Share this post


Link to post
Share on other sites

lol, yeah, or you could make sure the name you replace is the same length... if you don't know how todo the other stuff...

yeah, so I should have previously indicated that this was also an option... sorry, sometimes the brain gets a bit slack...

@Opteryx... hmmm, sorta hard to explain and even if I was inclined to try, it would be a very long winded explanation... and I don't think you'd want to suffer through that... also, not really the place to go over things of that nature...

Although it might seem interesting it really isn't much... it's just a case of staring at things for hours (sometimes mins. depending on your experience) until numbers & such jump out at you...

If you are really, really interested then try me on msn sometime...

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×