public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm) { if (worldParm.HasParm("Strength")) actorParm.AddParm("Strength", worldParm.GetFloat("Strength")); if (worldParm.HasParm("Direction")) actorParm.AddParm("Direction", worldParm.GetVector3("Direction")); }
public override void Serialize(ref ParameterSet parm) { parm.AddParm("InputAction", inputAction.name); parm.AddParm("KillOnButtonPush", killOnButtonPush); base.Serialize(ref parm); }
public static void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm) { if (worldParm.HasParm("DieOnTrigger")) actorParm.AddParm("DieOnTrigger", worldParm.GetBool("DieOnTrigger")); if (worldParm.HasParm("InputAction")) actorParm.AddParm("InputAction", worldParm.GetString("InputAction")); }
public override void Serialize(ref ParameterSet parm) { parm.AddParm("NewDir", newForwardDir); parm.AddParm("RotateRight", rotateRight); parm.AddParm("RotationTime", rotationTime); base.Serialize(ref parm); }
/// <summary> /// Read trigger specific parameters from the world parm and add them to the actor parm /// </summary> /// <param name="parm"></param> /// <returns></returns> public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm) { if (worldParm.HasParm("TextPosition")) actorParm.AddParm("TextPosition", worldParm.GetVector2("TextPosition")); if (worldParm.HasParm("Text")) actorParm.AddParm("Text", worldParm.GetString("Text")); }
public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm) { System.Diagnostics.Debug.Assert(worldParm.HasParm("InputAction"), "ButtonPushTriggerVolume requires an input action!"); actorParm.AddParm("InputAction", worldParm.GetString("InputAction")); if (worldParm.HasParm("KillOnButtonPush")) actorParm.AddParm("KillOnButtonPush", worldParm.GetBool("KillOnButtonPush")); }
public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm) { System.Diagnostics.Debug.Assert(worldParm.HasParm("NewDir"), "Rotate Camera requires a new direction!"); actorParm.AddParm("NewDir", worldParm.GetVector3("NewDir")); if (worldParm.HasParm("RotateRight")) actorParm.AddParm("RotateRight", worldParm.GetBool("RotateRight")); if(worldParm.HasParm("RotationTime")) actorParm.AddParm("RotationTime", worldParm.GetFloat("RotationTime")); }
/// <summary> /// Read trigger specific parameters from the world parm and add them to the actor parm /// </summary> /// <param name="parm"></param> /// <returns></returns> public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm) { if (worldParm.HasParm("Volume")) actorParm.AddParm("Volume", worldParm.GetFloat("Volume")); if (worldParm.HasParm("Pitch")) actorParm.AddParm("Pitch", worldParm.GetFloat("Pitch")); if (worldParm.HasParm("Pan")) actorParm.AddParm("Pan", worldParm.GetFloat("Pan")); if (worldParm.HasParm("Type")) actorParm.AddParm("Type", worldParm.GetString("Type")); System.Diagnostics.Debug.Assert(worldParm.HasParm("SoundName"), "PlaySoundTriggerVolume requires a sound name!"); actorParm.AddParm("SoundName", worldParm.GetString("SoundName")); }
private ParameterSet defaultParameters(ParameterSet old) { ParameterSet newParm = new ParameterSet(); foreach (KeyValuePair<string, string> kv in old) { if (kv.Key == "ModelName" || kv.Key == "Mass" || kv.Key == "PhysicsType") newParm.AddParm(kv.Key, kv.Value); } return newParm; }
/// <summary> /// Read trigger specific parameters from the world parm and add them to the actor parm /// </summary> /// <param name="parm"></param> /// <returns></returns> public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm) { if (worldParm.HasParm("Count")) actorParm.AddParm("Count", worldParm.GetInt("Count")); if (worldParm.HasParm("Freq")) actorParm.AddParm("Freq", worldParm.GetFloat("Freq")); if (worldParm.HasParm("SpawnInWaves")) actorParm.AddParm("SpawnInWaves", worldParm.GetBool("SpawnInWaves")); if (worldParm.HasParm("DelayForFirst")) actorParm.AddParm("DelayForFirst", worldParm.GetFloat("DelayForFirst")); if (worldParm.HasParm("ConstantSpawns")) actorParm.AddParm("ConstantSpawns", worldParm.GetBool("ConstantSpawns")); if (worldParm.HasParm("EnemyList")) actorParm.AddParm("EnemyList", worldParm.GetBool("EnemyList")); System.Diagnostics.Debug.Assert(worldParm.HasParm("ActorType"), "SpawnActorTriggerVolume requires an actor type to spawn!"); actorParm.AddParm("ActorType", worldParm.GetString("ActorType")); System.Diagnostics.Debug.Assert(worldParm.HasParm("SpawnPos"), "SpawnActorTriggerVolume requires a position to spawn at!"); actorParm.AddParm("SpawnPos", worldParm.GetString("SpawnPos")); }
public void CreateTrigger(string triggerType) { TriggerQB triggerQB = Stage.ActiveStage.GetQB<TriggerQB>(); ParameterSet parm = new ParameterSet(); parm.AddParm("AssetName", "TriggerVolume" + triggerQB.triggers.Count); parm.AddParm("ModelName", "TriggerVolume"); parm.AddParm("Mass", -1.0f); parm.AddParm("PhysicsType", "TriggerVolume"); parm.AddParm("Agents", triggerType); switch (triggerType) { case "PlaySoundTriggerVolume": parm.AddParm("SoundName", "guitarslide"); break; case "SpawnActorTriggerVolume": parm.AddParm("ActorType", "EnemyWeak"); parm.AddParm("SpawnPos", Vector3.Zero); parm.AddParm("Count", 1); parm.AddParm("Freq", 1.0f); parm.AddParm("DelayForFirst", 0.0f); parm.AddParm("SpawnInWaves", false); parm.AddParm("DelayForFirst",0); parm.AddParm("ConstantSpawns",false); parm.AddParm("EnemyList",false); break; case "RotateCameraTriggerVolume": parm.AddParm("NewDir", Vector3.Forward); break; } Vector3 pos = CameraQB.WorldMatrix.Translation + CameraQB.WorldMatrix.Forward * 30.0f; triggerQB.AddTrigger(parm, pos); }
public void SaveStage(string filename) { worldFile = filename; //create an empty ParameterSet ParameterSet newParms = new ParameterSet(); // add the asset name (world filename without extension) newParms.AddParm("AssetName", System.IO.Path.GetFileNameWithoutExtension(worldFile)); if (parms.HasParm("SunAngles")) newParms.AddParm("SunAngles", parms.GetVector2("SunAngles")); // in need a better solution // add the quarterback list to the parm set string qbs = ""; foreach (KeyValuePair<System.Type, Quarterback> qb in Stage.ActiveStage.QBTable) { //check if this is the first addition to the quarterbacks string qbs += qb.Value.Name() + ','; } qbs = qbs.Remove(qbs.Length - 1); // remove the last comma //add the qbs to the Quarterbacks key newParms.AddParm("Quarterbacks", qbs); foreach (KeyValuePair<System.Type, Quarterback> qb in Stage.ActiveStage.QBTable) { //serialize the current quarterback qb.Value.Serialize(newParms); } //set parms to newParms parms = newParms; //write file parms.ToFile(worldFile); }
public override void Serialize(ParameterSet parm) { //TODO:: //figure out what needs to be updated here if (levelTheme != null) parm.AddParm("SoundTheme", levelThemeString); int index = 0; foreach( string key in soundsLib.Keys) { parm.AddParm("Sound" + index++, key); } }
public override void Serialize(ParameterSet parm) { parm.AddParm("FirstScreen", firstScreenName); }
/// <summary> /// Read trigger specific parameters from the world parm and add them to the actor parm /// </summary> /// <param name="parm"></param> /// <returns></returns> public static new void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm) { //check for the bare minimum required parms System.Diagnostics.Debug.Assert(worldParm.HasParm("ControllerInput0"), "TutorialStopTriggerVolume requires a ControllerInput0!"); System.Diagnostics.Debug.Assert(worldParm.HasParm("GuitarInput0"), "TutorialStopTriggerVolume requires a GuitarInput0!"); System.Diagnostics.Debug.Assert(worldParm.HasParm("ControllerImage0"), "TutorialStopTriggerVolume requires a ControllerImage0!"); System.Diagnostics.Debug.Assert(worldParm.HasParm("GuitarImage0"), "TutorialStopTriggerVolume requires a GuitarImage0!"); System.Diagnostics.Debug.Assert(worldParm.HasParm("ControllerImagePos0"), "TutorialStopTriggerVolume requires a ControllerImagePos0!"); System.Diagnostics.Debug.Assert(worldParm.HasParm("ControllerImageSize0"), "TutorialStopTriggerVolume requires a ControllerImageSize0!"); System.Diagnostics.Debug.Assert(worldParm.HasParm("GuitarImagePos0"), "TutorialStopTriggerVolume requires a GuitarImagePos0!"); System.Diagnostics.Debug.Assert(worldParm.HasParm("GuitarImageSize0"), "TutorialStopTriggerVolume requires a GuitarImageSize0!"); int count = 0; while (worldParm.HasParm("ControllerInput"+count)) { actorParm.AddParm("ControllerInput"+count, worldParm.GetString("ControllerInput"+count)); actorParm.AddParm("GuitarInput"+count, worldParm.GetString("GuitarInput"+count)); actorParm.AddParm("ControllerImage"+count, worldParm.GetString("ControllerImage"+count)); actorParm.AddParm("GuitarImage"+count, worldParm.GetString("GuitarImage"+count)); actorParm.AddParm("ControllerImagePos"+count, worldParm.GetString("ControllerImagePos"+count)); actorParm.AddParm("ControllerImageSize"+count, worldParm.GetString("ControllerImageSize"+count)); actorParm.AddParm("GuitarImagePos"+count, worldParm.GetString("GuitarImagePos"+count)); actorParm.AddParm("GuitarImageSize"+count, worldParm.GetString("GuitarImageSize"+count)); //optional parms if (worldParm.HasParm("StrumRequired"+count)) actorParm.AddParm("StrumRequired"+count, worldParm.GetBool("StrumRequired"+count)); if (worldParm.HasParm("AllInputsRequired"+count)) actorParm.AddParm("AllInputsRequired"+count, worldParm.GetBool("AllInputsRequired"+count)); if (worldParm.HasParm("SpawnEnemy"+count)) actorParm.AddParm("SpawnEnemy"+count, worldParm.GetBool("SpawnEnemy"+count)); if (worldParm.HasParm("KillEnemies"+count)) actorParm.AddParm("KillEnemies"+count, worldParm.GetBool("KillEnemies"+count)); if (worldParm.HasParm("TriggerDelay"+count)) actorParm.AddParm("TriggerDelay"+count, worldParm.GetFloat("TriggerDelay"+count)); count++; } if (worldParm.HasParm("EndLevel")) actorParm.AddParm("EndLevel", worldParm.GetBool("EndLevel")); actorParm.AddParm("Num", count); }
public override void Serialize(ParameterSet parm) { //TODO:: //figure out what needs to be updated here parm.AddParm("Gravity", space.ForceUpdater.Gravity.X + " " + space.ForceUpdater.Gravity.Y + " " + space.ForceUpdater.Gravity.Z); }
public override void Serialize(ParameterSet parm) { int index = 0; foreach (Actor trigger in triggers) { TriggerVolume triggerVolume = trigger.agents[0] as TriggerVolume; // shouldn't be any other agents attached... parm.SetPrefix("TriggerVolume" + index); parm.AddParm("", triggerVolume.Name); parm.AddParm("Position", trigger.PhysicsObject.Position); parm.AddParm("ModelName", trigger.modelInstance.model.Name); triggerVolume.Serialize(ref parm); // trigger type specific parameters parm.ClearPrefix(); index++; } }
//this will break the game public override void Serialize(ref ParameterSet parm) { parm.AddParm("ControllerInput", actor.Parm.GetString("ControllerInput")); parm.AddParm("GuitarInput", actor.Parm.GetString("GuitarInput")); parm.AddParm("GuitarImage", actor.Parm.GetString("GuitarImage")); parm.AddParm("ControllerImage", actor.Parm.GetString("ControllerImage")); parm.AddParm("SpawnEnemy", spawnEnemy); parm.AddParm("KillEnemies", killEnemies); base.Serialize(ref parm); }
public override void LoadContent() { font = Stage.Content.Load<SpriteFont>("DefaultFont"); ActorQB actorQB = Stage.LoadingStage.GetQB<ActorQB>(); Vector3 rotation = Vector3.Zero; int index = 0; while (Parm.HasParm("TriggerVolume" + index)) { ParameterSet actorParm = new ParameterSet(); string prefix = "TriggerVolume" + index; string triggerVolumeType = Parm.GetString(prefix); Parm.SetPrefix(prefix); actorParm.AddParm("AssetName", Parm.GetPrefix()); actorParm.AddParm("ModelName", Parm.GetString("ModelName")); actorParm.AddParm("Mass", -1.0f); actorParm.AddParm("PhysicsType", "TriggerVolume"); actorParm.AddParm("DontDraw", !TriggersShown); TriggerVolume.ParseParmSet(ref actorParm, ref Parm); switch (triggerVolumeType) { // todo: add other types case "PlaySoundTriggerVolume": actorParm.AddParm("Agents", "PlaySoundTriggerVolume"); PlaySoundTriggerVolume.ParseParmSet(ref actorParm, ref Parm); break; case "SpawnActorTriggerVolume": actorParm.AddParm("Agents", "SpawnActorTriggerVolume"); SpawnActorTriggerVolume.ParseParmSet(ref actorParm, ref Parm); break; case "RotateCameraTriggerVolume": actorParm.AddParm("Agents", "RotateCameraTriggerVolume"); RotateCameraTriggerVolume.ParseParmSet(ref actorParm, ref Parm); break; case "HealthTriggerVolume": actorParm.AddParm("Agents", "HealthTriggerVolume"); HealthTriggerVolume.ParseParmSet(ref actorParm, ref Parm); break; case "TextToScreenTriggerVolume": actorParm.AddParm("Agents", "TextToScreenTriggerVolume"); TextToScreenTriggerVolume.ParseParmSet(ref actorParm, ref Parm); break; case "ButtonPushTriggerVolume": actorParm.AddParm("Agents", "ButtonPushTriggerVolume"); ButtonPushTriggerVolume.ParseParmSet(ref actorParm, ref Parm); break; case "AirBurstTriggerVolume": actorParm.AddParm("Agents", "AirBurstTriggerVolume"); AirBurstTriggerVolume.ParseParmSet(ref actorParm, ref Parm); break; case "TutorialStopTriggerVolume": actorParm.AddParm("Agents", "TutorialStopTriggerVolume"); TutorialStopTriggerVolume.ParseParmSet(ref actorParm, ref Parm); break; case "EndLevelTriggerVolume": actorParm.AddParm("Agents", "EndLevelTriggerVolume"); EndLevelTriggerVolume.ParseParmSet(ref actorParm, ref Parm); break; default: System.Diagnostics.Debug.Assert(false, "Unknown trigger volume type: " + Parm.GetString(prefix + index)); continue; } if (actorParm != null) { Vector3 position = Parm.GetVector3("Position"); Actor trigger = new Actor(actorParm, "Trigger", ref position, ref rotation, Stage.Content, Stage.LoadingStage); triggers.AddLast(trigger); } Parm.ClearPrefix(); index++; } }
Matrix[] transforms = null; // for non animated models #endregion Fields #region Constructors public WaterRModel(ParameterSet parm) : base(parm) { parm.AddParm("ApplyDecals", "false"); }
public Actor MakeCircle(string circleName, ContentManager content) { ParameterSet circleParm = new ParameterSet(); circleParm.AddParm("AssetName", circleName); circleParm.AddParm("ModelName", circleName); circleParm.AddParm("Mass", "-1.0"); circleParm.AddParm("PhysicsType", "Box"); circleParm.AddParm("ModelType", "EditorManipulator"); Vector3 zero = Vector3.Zero; return new Actor(circleParm, circleName, ref zero, ref zero, content, Stage.ActiveStage); }
public virtual void Serialize(ref ParameterSet parm) { parm.AddParm("DieOnTrigger", DieOnTrigger); if (requiresButtonPush) { parm.AddParm("InputAction", inputAction.name); } }
public virtual void Serialize(ref ParameterSet parm) { parm.AddParm("Health", health); }
public override void Serialize(ParameterSet parm) { parm.AddParm("EnemyWeakPoolSize",3); parm.AddParm("EnemyRangedPoolSize",3); parm.AddParm("EnemyHeavyPoolSize", 3); }
public static void ParseParmSet(ref ParameterSet actorParm, ref ParameterSet worldParm) { if (worldParm.HasParm("Health")) actorParm.AddParm("Health", worldParm.GetFloat("Health")); }
public override void Serialize(ref ParameterSet parm) { parm.AddParm("Strength", strength); parm.AddParm("Direction", direction); base.Serialize(ref parm); }
public override void Serialize(ref ParameterSet parm) { parm.AddParm("ActorType", ActorType); parm.AddParm("SpawnPos", position); parm.AddParm("Count", spawnCount); parm.AddParm("Freq", freq); parm.AddParm("SpawnInWaves", waveSpawn); parm.AddParm("DelayForFirst", delay); parm.AddParm("ConstantSpawns", constantSpawn); parm.AddParm("EnemyList", listOfEnemies); base.Serialize(ref parm); }
public override void Serialize(ref ParameterSet parm) { parm.AddParm("Text",text); parm.AddParm("TextPosition", textPosition); base.Serialize(ref parm); }
public override void Serialize(ref ParameterSet parm) { parm.AddParm("Volume", volume); parm.AddParm("Pitch", pitch); parm.AddParm("Pan", pan); parm.AddParm("SoundName", soundName); parm.AddParm("Type", Enum.GetName(typeof(SoundTriggerType), soundTriggerType)); base.Serialize(ref parm); }