ElijahHouck Posted July 15, 2009 Share Posted July 15, 2009 Here's what I want-The player is going to walk into an area (marker of some sort, I'm guessing), and when that happens, I want the Megaton explosion to go off at a set point. A few seconds later, a plane is going to follow a path from Point A/Point B, and a screeching jet engine sound will follow the same path at the same speed. As the plane reaches point B, I want a few Fat Man (or similar) explosions to go off. As these are going off, the player is moved to a different worldspace and the sequence is over. Image Reference-http://i208.photobucket.com/albums/bb147/Mr_Cooleo/Help.png Help would be greatly appreciated, as I have very little scripting experience, and don't really have the time right now to learn :) . Link to comment Share on other sites More sharing options...
Skree000 Posted July 16, 2009 Share Posted July 16, 2009 neat idea. is that the megaton plane reassembled using the parts from the map? thats neat! one reason why you might not have got an answer is because of that last line you posted, basically saying you want someone else to do it because you couldnt be bothered hehe.whether you intended it or not it kind of comes off as rude. We get a lot of people with grandiose ideas and no real means to accomplish them. If you showed some attempts at what you had so far or told us more, youd probably get some help faster. Also a request like this should probably go in the Mod Requests forum instead, where people looking to help out usually go to take on requests no worries though, cool idea, im sure youll get er done eventually. Id like to see a youtube video of the final mod with this sequence, sounds spectacular! Link to comment Share on other sites More sharing options...
Cipscis Posted July 16, 2009 Share Posted July 16, 2009 Here's my response from the Quick Question - Quick Answer thread: 1) First, the player will walk out of the office building's door, and into the blue area I marked to the right of it. The player walking into this area will start the sequence, and at the same time disable player controls.You'll want to use a trigger for this. For information on creating triggers, see Creating Primitives. The script for the trigger will use an OnTriggerEnter block to initialise the sequence, and then use a staged timer to control the sequence in a GameMode block (more on this later).2) The first part of the action I want happening is the Megaton explosion going off in the distance. This will happen almost as soon as the player walks into the marked area.This is easy - you'll need to place a marker where you want the explosion to go off, and in order to cause the explosion you can place it at the marker via PlaceAtMe. Don't worry about cleaning it up with MarkForDelete, the game engine automatically recycles RefIDs generated by placing explosions via PlaceAtMe so this can't cause any bloat. You'll also need to make sure that the marker is a persistent reference with a unique EditorRefID so that you can refer to it via script.3) The next part is the plane falling from the sky. I want it to follow the path I have drawn, or at least in that general direction. No crazy spins or anything, just the plane moving along that line.This is going to be the most difficult part. My initial impression is that this will require a simple animation, although I haven't the slightest idea how one could be created. You could try using a combination of GetPos, SetPos and GetSecondsPassed (to make it independent of framerate) to propel the plane along the path, but it mightn't look completely smooth. Of course, I could be wrong and it might look just like you want, but I can't say for sure without trying it.4) As it reaches the end of the path, a few Fatman explosions go off, the player is teleported out of the worldspace, and into the post-apocalyptic one.Once again, this is fairly easy to accomplish. You'll want to place markers where you want each explosion to go off, and place them via PlaceAtMe. In order to move the player to a different worldspace, create a marker that you want to move them to and use MoveTo to relocate the player. Here's how the basic structure of the script might look:int iStage ; 0 - Disable controls ; 1 - Set off megaton nuke explosion ; 2 - Initialise plane movement ; 3 - Plane movement ; 4 - Fatman explosions ; 5 - Relocate player, enable controls float fTimer float fSecondsPassed ; For caching GetSecondsPassed, which can't be called multiple times in a single iteration float fPosX float fPosY float fPosZ Begin OnTriggerEnter player if iStage else ; if iStage == 0 set iStage to 1 set fTimer to 0.2 DisablePlayerControls endif End Begin GameMode if fTimer > 0 set fTimer to fTimer - GetSecondsPassed elseif iStage == 1 set iStage to 2 EMHPlaneCrashMegatonNukeMarker.PlaceAtMe MegatonNuke elseif iStage == 2 set iStage to 3 PlaneCrashREF.Enable set fPosX to PlaneCrashREF.GetPos X set fPosY to PlaneCrashREF.GetPos Y set fPosZ to PlaneCrashREF.GetPos Z elseif iStage == 3 set fSecondsPassed to GetSecondsPassed set fPosX to fPosX + <xOffset> * fSecondsPassed set fPosY to fPosY + <yOffset> * fSecondsPassed set fPosZ to fPosZ - <zOffset> * fSecondsPassed if fPosZ < <finalValue> set iStage to 4 endif elseif iStage == 4 set iStage to 5 set fTimer to 3 EMHPlaneCrashFatmanMarker1.PlaceAtMe FatManNukeExplosion EMHPlaneCrashFatmanMarker2.PlaceAtMe FatManNukeExplosion EMHPlaneCrashFatmanMarker3.PlaceAtMe FatManNukeExplosion EMHPlaneCrashFatmanMarker4.PlaceAtMe FatManNukeExplosion EMHPlaneCrashFatmanMarker5.PlaceAtMe FatManNukeExplosion elseif iStage == 5 set iStage to 6 player.MoveTo EMHPlaneCrashAfterMathMarker endif End I've left the four values associated with the path of the plane blank for now. The numbers that you use will depend on the path that you want the plane to take. If you're wondering why I've used GetSecondsPassed, it's because that will make the movement of the plane independent of the framerate. The structure that I've used for this script is the one that I referred to earlier as a "staged timer". This structure is very useful for sequences such as this that consist of multiple scripted events separated by a time delay. Here's a general form of a staged timer:int iStage float fTimer ; In this example, some event is required to initialise the event by setting iStage to 1 ; However, it is possible to have an event start when iStage == 0, i.e. when the script first starts running Begin GameMode if fTimer > 0 set fTimer to fTimer - GetSecondsPassed elseif iStage == 1 set iStage to 2 set fTimer to 1.2 elseif iStage == 2 set iStage to 3 set fTimer to 0.3 elseif ... endif End As you can see, the timer can be reinitalised between different stages by setting the "fTimer" variable to a value greater than 0, and once it runs out the code for the next stage will be run. As you can see when looking at the script for the plane crash, you can also impose extra conditions that must be satisfied before the next stage begins instead of immediately setting "iStage" to the next value. You can also cause some pretty complicated scenes by setting the stage depending on some input, or even including some randomly determined events via GetRandomPercent.Due to the nature of the Quick Question - Quick Answer thread, it's probably best to keep all future discussion in this thread. Cipscis Link to comment Share on other sites More sharing options...
ElijahHouck Posted July 16, 2009 Author Share Posted July 16, 2009 one reason why you might not have got an answer is because of that last line you posted, basically saying you want someone else to do it because you couldnt be bothered hehe.whether you intended it or not it kind of comes off as rude. We get a lot of people with grandiose ideas and no real means to accomplish them. If you showed some attempts at what you had so far or told us more, youd probably get some help faster. Also a request like this should probably go in the Mod Requests forum instead, where people looking to help out usually go to take on requestsIf it sounded rude at all, I'm truly sorry :( . I'm really rushed for time right now (and probably for the next month or so), and don't get home until about 6:30. I usually end up falling asleep at about 10:00-ish, so that's only 3 and a half hours I can work on it per day- and that doesn't even include eating and other necessities. And no, it's actually from a modder's resource- search "Boeing" in the uploaded files forum ;) .And thanks Cipscis, I'll start workiing on it tonight. Link to comment Share on other sites More sharing options...
Recommended Posts