The three virtues of a programmer: Laziness, Impatience, and Hubris. – Larry Wall

UE2 talk:TeamVehicleFactory

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search

Archived Discussion

SuperApe: Originally this actor included a bForceAllow option that overrode the Level.bAllowVehicles setting. Since the latest patch to UT2004 moved that check up to SVehicle, that will not work anymore. Alas, that very cool option to include vehicles in any gametype would have to be left out. :( Now, I offer it as simply a way to get any vehicle class into gametypes which *do* allow vehicles. Enjoy! :)

MythOpus: Why couldn't you just set the bAllowVehicles property through the code?

SuperApe: You mean like this?

if ( !Level.Game.bAllowVehicles && bForceAllow )
    Level.Game.bAllowVehicles = true;

MythOpus: Yes, something like that :P :) Good luck.

SuperApe: No luck. I believe the new patch for 2k4 moved many of the bAllowVehicle checks either higher in the actor heirarchy, or like into SVehicle itself.

SuperApe: A request has been made by a mapper for Red Orchestra to include a Reset() function for this actor. If you have a triggered version of this factory and the map is reset, any outstanding vehicles are still there. Working...

SuperApe: I've added the Reset() function that should work fine. In fact, I had difficulty duplicating the problem of a stranded vehicle after map reset. Nevertheless, this Reset() function won't hurt and it may solve the problem for the Red Orchestra mapper.

SuperApe: Thanks to a suggestion by ZedMaestro on the BUF, I've added a feature for spawning random vehicle classes. Just set bRandomSpawn = true and the list of possible vehicle classes in RandomVehicles. Also, in relation to the above discussion about forcing to allow vehicles in any gametype, there is a SuperVehicleFactory in testing on the UnrealPlayground forums.

VitalOverdose: when i got cut offline i took a whole buch of the most difficult problems from atari forums and wiki and decided to crack each one as i was gonna be ofline for atleast 4months.your teamvehiclefactory idea was on i decided to have a go at.As far as i can see it does everything you specified in the orignal design spec. i was thinking between us we could come up with an ultimate solution but if not np.

SuperApe: I think I understand the confusion. The TeamVehicleFactory is not a problem which I am trying to find a solution for, it is a custom actor I've posted on the wiki after testing thoroughly and developing somewhere else. I post it here for others to use at their discretion, as a Third-Party component. If you would like to take the code, use it in a custom map, or even expand on it and modify it for specific purposes, that's fine by me. That's why I posted it here. Just remember, the normal etiquette is to give credit for the source in those situations, either in the map's readme file or the code's initial comment block, or both. If you would like help finding a solution to a problem you're having with your own code, I suggest posting (in brief) the problem's details on the Help Desk. Personally, I wasn't at all clear what you wanted help with. But at any rate, that code didn't belong here in the Discussion of this page. Thanks for moving it. :)

Moofed: I noticed the first vehicle that is spawned from a TeamVehicleFactory doesn't have a HeadlightProjector, but all vehicles afterwards do. Not sure what's causing it. :-/

SuperApe: Hmm. I'm not seeing that bug. Headlights are spawned from the vehicle (ONSVehicle) during PostNetBeginPlay(). Can't think of why your first vehicle wouldn't have them when you jump in.

Moofed: Fixed by setting PreSpawnTime=2. I think bDropDetail gets set (and the coronas and projectors not spawned) because the computer is bogged down by the level loading, which happens to be at the same time as the vehicles are spawning when using bAutoSpawn.

SuperApe: Ah, that makes more sense. Without including a default spawn effect, that is a potential problem with this script. I didn't see it due to the effects I include in the test map, linked to above. Perhaps I should add the suggested spawn effects as a small block of code. Thanks. :)

SuperApe: I believe the Reset() function does absolutely nothing. Vehicles themselves have their own Reset() functon, so it's redundant, IIRC. I will update the code with defaultproperties and include code for a default spawning Effects class to use with this factory as an option, so that mappers can choose to use custom spawning efx or not.

SuperApe: This class is included in Old Skool Monsta Toolz and adds the feature of bDefaultEFX, which spawns particles and sounds that indicate the team the vehicle is spawning for and the size of the vehicle about to spawn. I will update the code to match OSMT.TeamVehicleFactory soon.