Are all weapon lockers and pickup factories uniquely named by the editor? Are there any hashtable implementations in unrealscript?
Yes, every object has a Name property (defined in Core.Object); when placing an actor into a map the editor just appends a number to the class name, like 'WeaponLocker14'.
No, I don't think there are any hashtable-like structures in unrealscript, however I think you could just use Core.Object.FindObject() to get references to the actors you want, e.g.:
local UTWeaponLocker Locker; local string ActorName; Locker = UTWeaponLocker(FindObject(ActorName, class'UTWeaponLocker'));
Even if that doesn't work for whatever reason, fortunately these type of spot edits and replacements only have to be done once at the start of a map, so it doesn't matter a whole lot if you just do a lazy foreach loop with
if (string(A.Name) == ActorName)
or something.
That does leave out how to get the ActorName loaded, and there's all sorts of ways to do that of course. PerObjectConfig might be something to look into here, as you could set up a fairly elegant solution using a data class such as:
class MapPostProcessData PerObjectConfig;
struct WeaponLockerData
{
var string Locker;
var array<string> Add;
var array<string> Remove;
}
var array<WeaponLockerData> WeaponLocker;
Which would allow you to use a nice straightforward .ini file like:
[WAR-Torlan MapPostProcessData]
WeaponLocker=(Locker="WeaponLocker0",Add=("ONS2.ONS2Weap_BioGrenadeLauncher"))
WeaponLocker=(Locker="WeaponLocker12",Add=("ONS2.ONS2Weap_BioGrenadeLauncher","UTGameContent.UTWeap_Avril_Content"),Remove=("UTGame.UTWeap_RocketLauncher"))
[WAR-Dusk MapPostProcessData]
WeaponLocker=... etc.
Then to load the data objects you just retrieve their names and instantiate the one you want:
local array<string> Names; local int NameIndex; local MapPostProcessData PPData; GetPerObjectConfigSections(class'MapPostProcessData', Names, None); NameIndex = Names.Find(WorldInfo.Name); if (NameIndex == -1) return; // or whatever PPData = new (None, Names.NameIndex) class'MapPostProcessData';
And once you've got the PPData structure in hand it should be no trouble to get the actor reference with FindObject and go to work on it however you want.
Btw that last line of code especially was hard to understand at first for me. The not-so-obvious trick to it apparently is that when you're using the 'new' keyword to instantiate a PerObjectConfig class, by declaring a Name for the new object that matches one of the config entries (the level name e.g. "WAR-Torlan" from the example above), the engine automatically loads all the values for the associated config properties as recorded in the .ini file into the new object. See the comments in Core.Object.GetPerObjectConfigSections and the old UT2004 page on PerObjectConfig for more about how this works.
I'm not sure all the details are fleshed out there and I may have a thing or two a bit wrong, but it's not far off. Anyway that's what I'd suggest ... it's a mindbender at first but the end result is VERY powerful ... depending on how intense you get with the structures you define in the data class, you can make all kinds of very specific edits to any map that would otherwise require republishing the whole thing and all the buttpain of downloads, new map packs, etc. involved with that.
And nice repo browser setup pacer! Very handy tool for admiring all your masterpieces 
oh and for the record I vote for exploding a few bits of "bio shrapnel" if the grenade is big enough -- that would be cool looking and complement the theme nicely. Glad you got the bio effects to show too, also very cool. ![]()




Ok lets change the name but keep the ONS 2.0 party as advertised. I'm fine with WarfareX and agree that what we have is a tuned up version of WAR.
ONS was killed and buried in 2k4 by Epic. I think people will be more responsive if we use a current gametype to base this project off of, even though it is heavily influenced by ONS..
i dont know why they wont work. you would think if it could lift a tank it could lift a hellbender... wtf?!?
Recent comments
20 hours 49 min ago
1 day 1 hour ago
1 day 2 hours ago
1 day 14 hours ago
2 days 11 hours ago
3 days 23 hours ago
4 days 8 min ago
4 days 33 min ago
4 days 1 hour ago
4 days 2 hours ago