Thread: Reusing/duplicating complex entity systems

Results 1 to 17 of 17
  1. #1
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,599

    Reusing/duplicating complex entity systems

    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++ (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.
    Last edited by w00tguy123; 29-09-2011 at 08:18 PM.
    Love,
    w00tguy

  2. #2
    Administrator JPolito's Avatar  
    Manager
    Join Date
    Apr 2004
    Posts
    7,555

    Re: Reusing/duplicating complex entity systems

    That is pretty damn awesome.

  3. #3
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,485

    Re: Reusing/duplicating complex entity systems

    This could have been a great help when I made turretfortress...

  4. #4
    I am yummy LemonSoda's Avatar
    Join Date
    Jul 2007
    Location
    Finland
    Posts
    719

    Re: Reusing/duplicating complex entity systems

    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.

  5. #5
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,599

    Re: Reusing/duplicating complex entity systems

    ^ 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.
    Last edited by w00tguy123; 04-08-2011 at 05:25 PM.
    Love,
    w00tguy

  6. #6
    Sven Co-op animator, beta tester, halfway decent modeler WAR_Nuker's Avatar
    Join Date
    May 2006
    Posts
    2,729

    Re: Reusing/duplicating complex entity systems



    weekly tips by wootguy? lol

  7. #7
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,599

    Re: Reusing/duplicating complex entity systems

    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.
    Love,
    w00tguy

  8. #8
    I am yummy LemonSoda's Avatar
    Join Date
    Jul 2007
    Location
    Finland
    Posts
    719

    Re: Reusing/duplicating complex entity systems

    Quote Originally Posted by w00tguy123 View Post
    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!

  9. #9
    Mapper Nih's Avatar  
    Manager
    Join Date
    Dec 2002
    Location
    Denmark
    Posts
    5,485

    Re: Reusing/duplicating complex entity systems

    Do it. If the tips are too small to warrant their own thread, just make a combined tips thread.

  10. #10
    Contributor goanna's Avatar
    Join Date
    Sep 2002
    Location
    Watertown, New York, U.S.A.
    Posts
    2,259

    Re: Reusing/duplicating complex entity systems

    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.

  11. #11
    Owned by Leak
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    59

    Re: Reusing/duplicating complex entity systems

    Quote Originally Posted by LemonSoda View Post

    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.
    www.seven-gaming.de

    Sven Coop v4.5 | seVen-gaming.de [FastDL] 176.9.17.66:27030

  12. #12
    Still learning wolf-3d's Avatar  
    Tester
    Join Date
    Jan 2011
    Location
    Somewhere Warm.
    Posts
    1,474

    Re: Reusing/duplicating complex entity systems

    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

  13. #13
    Administrator AdamR's Avatar  
    Manager
    Join Date
    Mar 2004
    Location
    Cardiff, South Wales [UK]
    Posts
    8,593

    Re: Reusing/duplicating complex entity systems

    Quote Originally Posted by w00tguy123 View Post
    Duplicate your .map or .rmf and open it up with Notepad++. 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.
    Adam "Adambean" Reece
    Sven Co-op team

    Also on: Steam | Facebook | Twitter | YouTube | Twitch
    Released AMXX plug-ins: Bind number slots | NextMap with Sven Co-op fix | Sven Co-op administrator icons

  14. #14
    Owned by Leak
    Join Date
    Aug 2011
    Location
    Germany
    Posts
    59

    Re: Reusing/duplicating complex entity systems

    Quote Originally Posted by wolf-3d View Post
    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.
    www.seven-gaming.de

    Sven Coop v4.5 | seVen-gaming.de [FastDL] 176.9.17.66:27030

  15. #15
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,599

    Re: Reusing/duplicating complex entity systems

    @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).
    Love,
    w00tguy

  16. #16
    Administrator AdamR's Avatar  
    Manager
    Join Date
    Mar 2004
    Location
    Cardiff, South Wales [UK]
    Posts
    8,593

    Re: Reusing/duplicating complex entity systems

    :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
    Adam "Adambean" Reece
    Sven Co-op team

    Also on: Steam | Facebook | Twitter | YouTube | Twitch
    Released AMXX plug-ins: Bind number slots | NextMap with Sven Co-op fix | Sven Co-op administrator icons

  17. #17
    Administrator AdamR's Avatar  
    Manager
    Join Date
    Mar 2004
    Location
    Cardiff, South Wales [UK]
    Posts
    8,593

    Re: Reusing/duplicating complex entity systems

    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.
    Adam "Adambean" Reece
    Sven Co-op team

    Also on: Steam | Facebook | Twitter | YouTube | Twitch
    Released AMXX plug-ins: Bind number slots | NextMap with Sven Co-op fix | Sven Co-op administrator icons

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •