Handling Kismet events in UnrealScript
I'm attempting to write a mutator which would allow transport of orbs and flags in vehicles as chosen by the server administrator.
My first idea -- subclassing UTVehicleFactory and extending the vehicle spawning function -- failed because UTVehicleFactory is subclassed for every single vehicle type, and I want to write a (more or less) end-all, be-all solution for all UTVehicles. My second idea was to monitor whenever a new vehicle is added into the game, check if it's one of the "flag-enabled" ones, and change its properties accordingly. However, the only way I seem to be able to do this efficiently (i.e. not every tick) is to handle the vehicle factory Kismet event (the Spawned event, IIRC).
Enumerating all the VehicleFactories should be very easy, but is there a way I can subscribe to the Spawned event and call an UnrealScript function when it's triggered?
Thanks in advance for answering my impertinent questions. Your assistance is highly appreciated.
You should be able to use a function in the Mutator class (though I always mess up with what which function does ). When a vehicle is spawned, it will be passed through there and then you can change the bCanCarryFlag when appropiate.
Is it CheckReplacement? I thought that was only called for each object already placed on the map (by the mapper), but I may be wrong. I should probably check it.
<-- This guy is stupid.
Seriously, CheckReplacement is called for every*spawn... and I was trying to build a molehill with a bulldozer.
I got it to work and might be releasing soon.