ElijahHouck Posted July 16, 2009 Share Posted July 16, 2009 Hello again :) . I'm making progress on the same mod as last time (the message script worked like a charm), and now I have a more complex question. I'm wanting to create a sequence of what happened the day the bombs dropped on my hometown (Alton, IL), and I'm going to accomplish this by a slightly cleaner looking worldspace with the Tranquility Lane climate. It's going to be a fairly short sequence- it will consist of leaving your office, walking outside, and then this will start. 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.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.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.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. http://i208.photobucket.com/albums/bb147/Mr_Cooleo/Help.pngI realize this might not be "quick," but I tried posting it in a new topic and I figure this is better than just bumping the old one. Ignore that the image says the plane will disappear, that's no longer needed. Link to comment Share on other sites More sharing options...
Warll Posted July 16, 2009 Share Posted July 16, 2009 1. Are you sure that is far enoguh away? The blast was very large and would(I think) put the entire town in a flash. The flash would have to clear before the plane crashes otherwise you player would not see it. Moving the blast far enough away would solve this.3. I don't know anything about moving static objects.4. Cipscis will know how exactly but my guess would be to time everything and use a timed script for it. In the orange box it talks about sound, check the engine sound from megaton, you know the one you hear when it first opens. Link to comment Share on other sites More sharing options...
ElijahHouck Posted July 16, 2009 Share Posted July 16, 2009 Yeah, I was thinking farther back would be better too, but since the GECK doesn't show very many cells at a time, I had to shove it there ;) . Link to comment Share on other sites More sharing options...
Warll Posted July 16, 2009 Share Posted July 16, 2009 I think I saw that once, I had opened the metro kit cell. But that one was huuuuge. You should be able to work around it. For instance move everything to far axises. Also if I remember right it was only a warning and not a error, have you tried it in game? Link to comment Share on other sites More sharing options...
ElijahHouck Posted July 16, 2009 Share Posted July 16, 2009 I think I saw that once, I had opened the metro kit cell. But that one was huuuuge. You should be able to work around it. For instance move everything to far axises. Also if I remember right it was only a warning and not a error, have you tried it in game?What do you mean? I'm way to tired to be using the GECK :P ... I need some sleep. Link to comment Share on other sites More sharing options...
Cipscis Posted July 16, 2009 Author Share Posted July 16, 2009 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 this problem, I wouldn't be surprised if there is more discussion of it in the future. Because of the nature of this thread, it's probably best if this future discussion stays in the thread that you opened for this problem. I've copied this response into that thread, and anyone interested in seeing what happens with this can find it here - Need help with script! Cipscis Link to comment Share on other sites More sharing options...
katsu4649 Posted July 16, 2009 Share Posted July 16, 2009 Hi Cipscis, I have a quick question in need of a quick answer! I have already posted a new thread, but was hoping maybe I would get a faster response if I put it here. Here is an exact copy of what my post said:I have used Max 2009 before and niftools worked great. But currently, I have Max 2010, and none of the plugins (From max 5-2009) work with Max 2010 (I realize that may sound absurd to have even tried, but how different could the plugin system be from 2009-2010? haha).So essentially, what I was wondering is this: What must I do in order to make the NifTools from the sourceforge website work, or, what is the correct plugin that I should be using. Or even, if the answer is so obvious that you are barely keeping yourself from reaching through the internet and slapping me, what have I done wrong? All help is greatly appreciated,-Katsu Link to comment Share on other sites More sharing options...
Warll Posted July 16, 2009 Share Posted July 16, 2009 Ok so I have a generator that you player can destroy and I would like it to disable a light when they do that. How do I do this? Link to comment Share on other sites More sharing options...
Cipscis Posted July 17, 2009 Author Share Posted July 17, 2009 @katsu4649:I'm afraid I have absolutely no experience with 3DSMax, so I don't know how to answer your question. Hopefully someone else will be able to help you though. @Warll:The easiest way to do this would be to attach the script to the generator, which would require it to be a type of item that can have a script attached to it. You could use a OnDestructionStageChange to Disable the light when the generator is destroyed. Cipscis Link to comment Share on other sites More sharing options...
cmal Posted July 17, 2009 Share Posted July 17, 2009 When in the repair menu, you probably need to add/remove an item that will be visible, i.e. an item in the repair list of the item that is currently being repaired. Currently FOSE does have the GetRepairList and SetRepairList functions available, and it might be possible to refresh the menu by quickly swapping the repair list of the relative item to a dummy list and back to the proper list, but as far as I know there is no current way to tell what the inventory item that is currently being repaired is. You could test these methods with an example items to see if they work, but I don't think a general solution will be possible with the current version of FOSE, unless of course you can sort through a list of items that are being affected. CipscisTried swapping repair lists (blanks, dupes, and modified), nothing. Tried adding/removing an item that's on the repair list, nothing. Tried adding an item but not removing it, nothing. Tried adding an item that needed repairing but not removing it, nothing. I even tried swapping the repair list and adding an item, still nothing. I'm beginning to think there's nothing I can do about the lag in the vendor repair menu, at least at this time. I want your opinion on what I should do next, Cipsis: use it as is with the lag and tell users its an issue, or just give it a value and don't look back? Thanks for the help. Link to comment Share on other sites More sharing options...
Recommended Posts