PDA

View Full Version : Handling Kismet events in UnrealScript



Ravu al Hemio
11-16-2007, 08:53 PM
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. :D

Jrubzjeknf
11-17-2007, 05:10 AM
You should be able to use a function in the Mutator class (though I always mess up with what which function does :p). When a vehicle is spawned, it will be passed through there and then you can change the bCanCarryFlag when appropiate.

Ravu al Hemio
11-17-2007, 05:48 AM
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.

Jrubzjeknf
11-17-2007, 07:19 AM
Log it. :p

Ravu al Hemio
11-17-2007, 08:01 AM
<-- 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.