/****************************************************************************** SBTriggerableSpawnPoint: Spawns the given *Prototype* at its location each time this SpawnPoint is triggered. Also its Event is fired on successful spawn. Optionally there can be up to 8 properties assigned to the spawned Actor by setting the name in the array *PrototypeProperties* and the value in array *PrototypePropertyValues*. Release Version 0: 2023-07-10 Author: SeriousBarbie AT Barbies DOT World ******************************************************************************/ class SBTriggerableSpawnPoint expands NavigationPoint; #exec Texture Import File=Textures\SBTSP.pcx Name=SBTSP Mips=Off Flags=2 var() class Prototype; var() String PrototypeProperties[8]; // Properties to change var() String PrototypePropertyValues[8]; // their values function bool ChangeProperties(Actor A) { // returns TRUE if change was successful local int i; local int bError; for (i=0; i < ArrayCount(PrototypeProperties); i++) if (PrototypeProperties[i] != "") { if ( ! SpecialPropertyHandling(A, PrototypeProperties[i], PrototypePropertyValues[i], bError)) { A.SetPropertyText(PrototypeProperties[i], PrototypePropertyValues[i]); if (A.GetPropertyText(PrototypeProperties[i]) != PrototypePropertyValues[i]) bError = int( ! (A.GetPropertyText(PrototypeProperties[i]) == "None" && PrototypePropertyValues[i] == "")); // special equal case: "None == ''" else bError = int(false); } if (bool(bError)) warn("Setting property '" $ PrototypeProperties[i] $ "' with value '" $ PrototypePropertyValues[i] $ "' failed, current value=" $ A.GetPropertyText(PrototypeProperties[i])); } return ! bool(bError); } function bool SpecialPropertyHandling(Actor A, string PropName, string PropValue, out int bError) { // Returns TRUE if a special property name was detected. // *bError* is FALSE if no error had occoured. if (PropName ~= "CollisionRadius") { A.SetCollisionSize(float(PropValue), A.CollisionHeight); bError = int(A.CollisionRadius != float(PropValue)); return true; } if (PropName ~= "CollisionHeight") { A.SetCollisionSize(A.CollisionRadius, float(PropValue)); bError = int(A.CollisionHeight != float(PropValue)); return true; } if (PropName ~= "bCollideActors") { A.SetCollision(bool(PropValue)); bError = int(A.bCollideActors != bool(PropValue)); return true; } if (PropName ~= "bBlockActors") { A.SetCollision(, bool(PropValue)); bError = int(A.bBlockActors != bool(PropValue)); return true; } if (PropName ~= "bBlockPlayers") { A.SetCollision(, , bool(PropValue)); bError = int(A.bBlockPlayers != bool(PropValue)); return true; } return false; } event Trigger(Actor Other, Pawn EventInstigator) { local Actor A, temp; local rotator newRot; temp = Spawn(Prototype); if (temp == None) warn("could not spawn" @ Prototype); else { newRot.yaw = rotation.yaw; temp.SetRotation(newRot); ChangeProperties(temp); if( Event != '' ) foreach AllActors(class'Actor', A, Event) A.Trigger(Self, Instigator); } } defaultproperties { bDirectional=true Texture=Texture'SBTSP' }