stronghold management

Post » Fri May 27, 2011 8:09 am

How are strongholds managed in Morrowind CS?
Is it all done by script? Where in the Mod Makers Manual does it cover if/then statements for hiding and placing exterior objects?
Trying to look around but I'm feeling noobish and the manual is huge. If someone could point me in the right direction, that would be swell. Like, call out a page or something. You'll be like; 162!! And then I'll be like; Ok Thxz!
But seriously.
User avatar
Alexx Peace
 
Posts: 3432
Joined: Thu Jul 20, 2006 5:55 pm

Post » Thu May 26, 2011 8:50 pm

The dialogue starts the scripts; for example, when you turn in the stronghold items to Hlaalu, it runs the command StartScript Strong_Build_Start_H. This script tracks the day, and after a certain number of days it updates the journal with Journal HH_Stronghold 55 and updates the variable that changes how built-up all the strongholds are, set Stronghold to 1. The journal tells the player to talk to the stronghold builder, and do something for them; again, the dialogue starts the next script, StartScript Strong_Build1_H. This script also waits a number of days, then runs the commands Journal HH_Stronghold 100 and set Stronghold to 2. Again, dialogue with the builder starts the next stronghold build script, StartScript Strong_Build2_H, which waits a number of days then runs the commands Journal HH_Stronghold 200 and set Stronghold to 4. Again, dialogue with the builder starts the next stronghold build script, StartScript Strong_Build3_H, which waits a number of days then runs the commands Journal HH_Stronghold 300 and set Stronghold to 6.

Each item in the exterior cells for the strongholds checks the variable stronghold, using a script like this:
Begin Strong1if ( Stronghold > 0 )	if ( GetDisabled == 1 )		enable	endif	else	if ( GetDisabled == 0 )		disable	endifendifEnd

User avatar
Katharine Newton
 
Posts: 3318
Joined: Tue Jun 13, 2006 12:33 pm

Post » Fri May 27, 2011 11:35 am

Heh, i just got done making a "stronghold" in my mod. Doesn't really say anything ..if you're refering to the MWSFD. You can probably do it more than one way the way i did it and it workds perfectly for me. Is the one above scriipt will work. The thing is you can't use statics you have to use activators or something else where you can attach the script to them. You can attach the above script to an activator for example. There is one more script you will need too.

begin SM_rebuild_dayCshort daysPassedshort myDay;global GuildHall;stop once enough time has passed.if ( GuildHall > 0 )StopScript SM_Rebuild_DayCReturnendif;when stronghold starts building, store the current dayif ( daysPassed == 0 )set myDay to Dayset daysPassed to 1endif;if we've already set a day, count the daysif ( myDay != Day );presumably it went up...set daysPassed to daysPassed + 1set myDay to Dayendif;wait x days for the stronghold to be built, give journal, set global;make sure player is NOT in the cell while the stuff goes "poof"if ( GetPCCell "Sadrith Mora" == 0 )if ( daysPassed > 1 )Journal SM_rebuildFG 80set GuildHall to 1endifendifEnd


I basically just copied that script from the stronghold script and made it my own with my own variables. that script is a global script and you activate via the dialogue. You have to create a global variable for this to work. So you will need tribunal or you can't set a global variable. My global variable i used was "guildhall" and the ones bethesda used was "stronghold".


There might be another way to do this, but i think this is the easiest. Seeing as how bethesda did it like this i assume it's the easiest.
User avatar
naana
 
Posts: 3362
Joined: Fri Dec 08, 2006 2:00 pm

Post » Fri May 27, 2011 4:21 am

Just because Bethesda did it that way doesn't mean it's the easiest. Haha.. but in this case, it is.

I'll just explain a bit more. As you may already know, you cannot attach scripts to statics because they are just that- static (unchanging). So, if you'd like to use ex_hlaalu_building_01 (forget if that's the actual name, I'm going off memory here), you'll have to create a new activator with the same mesh. For easy reference, open up ex_hlaalu_building_01's stats window, and open a new activator window. In the new activator window, just type in the path to the mesh straight from the corresponding static's window, and hit enter- name it and save it. Voila! Now you can attach a script to your new activator.

Stronghold building is typically initiated through dialogue with an NPC. So, you're going to have one global script that controls the entire building process, and that script will be launched from the appropriate response in the dialogue of your choice. Once started, have your script keep track of the days since it started, incrementing a counter as it goes along. Have the script test for some condition (usually a journal entry) and if the counter is at a value of your choice- if both are true, "build" the next stage (by activating the activators) and wait for the next stage after that.

Keep that script running until the entire stronghold has been built, at which point it is safe to terminate it- unless you have other reasons to keep it running (scripted event X days after the stronghold is built, etc).

Usually, a good aesthetic style is to have "construction materials" lying around your stronghold to indicate that it is indeed under construction. In that case, you'll want to place them all around and disable them initially, enabling them as you go along with the stages. Be sure to disable them when you're done with them, or you'll get some ugly clipping. I'm pretty sure there are already scaffolds and bucket activators- you could add in some log and plank activators, too.
User avatar
Charles Mckinna
 
Posts: 3511
Joined: Mon Nov 12, 2007 6:51 am

Post » Fri May 27, 2011 2:09 am

Wow, that was easier than I thought it would be. I guess it's just a matter of getting all the functions down.
Thanks for the help. :)
User avatar
Anna Kyselova
 
Posts: 3431
Joined: Sun Apr 01, 2007 9:42 am


Return to III - Morrowind