Could anyone help me please?
I'm trying to nail down the start-line system for my Micro Machines map, whereby the cars become responsive to input only when the green light goes & the race begins.
The code to control the cars' response is handled, but I'm having problems trying to get my vehicles to listen for an Event, sent out by a Trigger actor, an AIScript>TriggerEvent action, any actor that's capable of broadcasting it's Event property, or <console type>CauseEvent command, and then setting a Boolean variable to True.
This doesn't work, but hopefully it'll give you the idea of what I mean;
Y'see, the mapping system relies on a mapper using any Trigger system of his own devising, to create any system as long as it ends with a "RaceStart" Event, so the cars know when to become responsive.Code://<- Listen for event "RaceStart" and set bRaceBegun to True //================================ function Trigger (actor Other, pawn EventInstigator) { local bool strEvent; strEvent = Other.GetPropertyText("Event"); If (strEvent == "RaceStart") { bRaceBegun = True; //<- Let race begin Log("RaceBegun"); Level.Game.Broadcast(self, "Race Begun", 'Say'); } Super.Trigger(Other, EventInstigator); }
When bRaceBegun == True, the vehicles suddenly become responsive to input, and they can all start the race.
As you can see;
Working code - Just here for example;
It's so they can come up with weird & wacky looking start lines on their maps, with lights, movers, emitters & other bells & whistles, all hooked into ther own Tag/Events, but when the mapper sends his master "RaceStart" event, that's when the race "officially" starts.Code://============================ //<- This sub keep cars unresponsive to input until RaceBegun = True If (bRaceBegun == False && bPerformStartCheck == True) { Self.Throttle = 0; } If (bRaceBegun == True && bPerformStartCheck == True) { Self.Throttle = Self.Default.Throttle; bPerformStartCheck = False; //<- So we don't run this check any more }
Any help would be much appreciated, I've been through the WaitForEvent scripted actions' code, but to be perfectly hones I made neither head nor tail of it, all I need to do is hear an Event & set a boolean.
Cheers.





Reply With Quote

If I can use your example further - I'd like my cars (and eventually I'll transplant this code into the mut) to listen out for *all* events called, and single out a hardcoded one.


Bookmarks