PDA

View Full Version : Reusing/duplicating complex entity systems



w00tguy123
04-08-2011, 03:34 PM
So you have this giant chunk of entities that you plan to reuse in your map (maybe some sort of a per-player system). Hopefully, you've prefixed all of the keyvalues in each ent with something like "system1_". Maybe you have about 100 keyvalues to change, just so you can have a duplicate set of ents prefixed with "system2_". Going through each keyvalue in hammer would take forever, and you know you're going to mess up a few times and break the map.

The solution? Duplicate your .map or .rmf and open it up with Notepad++ (http://notepad-plus-plus.org/download/v5.9.3.html) (WARNING: Saving an .rmf with a text editor other than NP++ might break the .rmf. Editing .maps is the safest). Press Ctrl+f and replace every instance of "system1_" with "system2_". Save it, and open the duplicated map in hammer. Copy and paste the renamed ents into your unaltered map. BAM! hours of work compressed into seconds.

A couple of experienced mappers I know were unaware you could do this, so I figure posting this will help others, too.

JPolito
04-08-2011, 04:00 PM
That is pretty damn awesome.

Nih
04-08-2011, 04:15 PM
This could have been a great help when I made turretfortress...

LemonSoda
04-08-2011, 04:46 PM
This is good to know. Thanks for the tip w00tguy. :)

Also if you want to copy the same value for many ents its possible to just select them all in hammer and type the correct value to the field, it gets copied to all selected ents. Though all of you probably already knew about this since its so basic. But for me it was quite a surprise and a relief not too long ago when i noticed the ents work well even after copying values weirdly like that, somehow i thought they would mess up and always did it manually just in case.

w00tguy123
04-08-2011, 05:17 PM
^ yea, that is helpful, too. Except, multi_managers act a little strangely with that method.

If you add a keyvalue to a bunch of multi_mangers, not only will they all get that keyvalue, but they will also become exact copies of each other (holding of all the keyvalues you see in the "object properties" menu). Thankfully, you can delete a keyvalue from all of the selected _managers without having this problem.

WAR_Nuker
04-08-2011, 05:31 PM
http://images.jambase.com/fans/Human_Centipede/the_more_you_know.jpg

weekly tips by wootguy? lol

w00tguy123
04-08-2011, 05:49 PM
lol, I was thinking about starting some more threads about some stuff people might not know, but I don't want to start cluttering things up in here.

LemonSoda
05-08-2011, 02:25 AM
lol, I was thinking about starting some more threads about some stuff people might not know, but I don't want to start cluttering things up in here.

Do it plz! :)

Nih
05-08-2011, 02:32 AM
Do it. If the tips are too small to warrant their own thread, just make a combined tips thread.

goanna
05-08-2011, 05:53 AM
That would be interesting; w00tguy123's weekly knowledge tid bit like nuker said: Did You Know?. Have his own thread and each week list a new slice of info, even if people may already know the info. Someting to pull people into the forums more.

Wiede
29-09-2011, 07:40 AM
Also if you want to copy the same value for many ents its possible to just select them all in hammer and type the correct value to the field, it gets copied to all selected ents. Though all of you probably already knew about this since its so basic. But for me it was quite a surprise and a relief not too long ago when i noticed the ents work well even after copying values weirdly like that, somehow i thought they would mess up and always did it manually just in case.


old thread is old ^_^

but: this doesn't work all the time for me e.g. when i want to change values of more than 1 monster_xxx of the same type. Don't know why, but e.g. i select 4 Robogrunts of same settings, changes aren't applied to all e.g. squadname.

wolf-3d
29-09-2011, 11:39 AM
Humm, strange it works for me, (even across Hammer windows/maps, which is a problem for me and has lead to some "serious head scratching" when I have done it by accident).

I am using hammer 3.4 with the 3.5 after patch and running XP, can't think of anything else that might effect it.

regards
Wolf-3D

AdamR
29-09-2011, 12:36 PM
Duplicate your .map or .rmf and open it up with Notepad++ (http://notepad-plus-plus.org/download/v5.9.3.html). Press Ctrl+f and replace every instance of "system1_" with "system2_". Save it, and open the duplicated map in hammer. Copy and paste the renamed ents into your unaltered map. BAM! hours of work compressed into seconds.
How does this not completely corrupt your RMF?

This can work fine with the MAP as that is a plain text file, but the RMF is a proprietary binary format. If you open it in a text editor and save it there is a high chance all the 0x00 (null) will be converted into 0x20 (space).

It's much safter to mass-replace strings in a binary file using a binary file editor like HxD or WinHex.

Wiede
29-09-2011, 02:21 PM
Humm, strange it works for me, (even across Hammer windows/maps, which is a problem for me and has lead to some "serious head scratching" when I have done it by accident).

I am using hammer 3.4 with the 3.5 after patch and running XP, can't think of anything else that might effect it.

regards
Wolf-3D

Don't know why. Win 7. Hammer 3.4 with 3.5-exe

Doesn't really mather, cause really dont need it to copy that certain values.

w00tguy123
29-09-2011, 08:17 PM
@Adam: Notepad++ can read and write null characters (as well as some others), but that's a good point *edits first post*.

Someone I know has gotten corrupted .rmfs and even .maps by doing this, but I'm not sure what the cause was (he blamed hammer).

AdamR
29-09-2011, 11:40 PM
:o the .map should be fine to edit. I do it quite often. It's useful for correcting complex brushes Hammer is incapable of writing. Also means you can have brushes with floating points -- GoldSrc is very capable of handling those, but apparently Hammer is not.

Editing the RMF in a binary editor will be fine for strong replacements. WinHex is awesome at it, but is t free. HxD is free though :D

AdamR
10-10-2011, 10:41 AM
Just tried this out now.

CRUCIAL TIP: Your strings for copied/renamed entities MUST have the same string length as these strings are not NULL terminated. They are read at pre-defined lengths.

If your strings change size without updating the memory allocations your RMF will NOT load at all.