Ramengelion Posted April 23, 2006 Share Posted April 23, 2006 Alright, I am working on a project in which I need help figuring out how to script a magic effect which would prevent the player from waiting (At all) and only let the player sleep for 1 hour at a time. This sounds quite drastic, but it is actually for balance. If you could offer anything at all it would be nice. A PM would work well. I think it might have to do something with the "No Waiting/Sleeping while Enemies are around" but changing the message, but the 1 hour only sleep is the part that confuses me. Again, any insight at all would be greatly appricated. And of course, credits to the people that help. Link to comment Share on other sites More sharing options...
DragoonWraith Posted April 24, 2006 Share Posted April 24, 2006 Alright, I am working on a project in which I need help figuring out how to script a magic effect which would prevent the player from waiting (At all) and only let the player sleep for 1 hour at a time. This sounds quite drastic, but it is actually for balance. If you could offer anything at all it would be nice. A PM would work well. I think it might have to do something with the "No Waiting/Sleeping while Enemies are around" but changing the message, but the 1 hour only sleep is the part that confuses me. Again, any insight at all would be greatly appricated. And of course, credits to the people that help. Not certain it'll work, but you might try this Global Script: scn PlayerWakeUp short WakeHour short doOnce Begin MenuMode 1012 ;during Wait/Sleep if ( doOnce == 0 ) set WakeHour to ( GameHour + 1 ) set doOnce to 1 endif if ( GameHour >= Hour ) set doOnce to 0 WakeUpPC endif end You might also be able to prevent the player from choosing anything other than 1 using GetPCSleepHours, but I think that'd be tricky and entirely unnecessary. This should wake up the player after an hour. Add Message, "whatever" before WakeUpPC if you'd like to explain to the player why he was woken up. EDIT: You'd have to either add something to this to tell the game to only create this affect in specific area(s), or else, instead of a Global Script, add this to an object that you hide somewhere in every cell you want this to be true in... Link to comment Share on other sites More sharing options...
Ramengelion Posted April 24, 2006 Author Share Posted April 24, 2006 Perfect! I thought of the Global Scripts but I came up with one problem. How do I make it a spell effect (This is what I have thought of) so I can make it given to the player with an Ability. This would mean adding the SpellEffectStart lines, and can you contain that within a spell effect? I tried just using that script within a spell script, but I do not see a way to contain it within a spell. Link to comment Share on other sites More sharing options...
DragoonWraith Posted April 24, 2006 Share Posted April 24, 2006 Perfect! I thought of the Global Scripts but I came up with one problem. How do I make it a spell effect (This is what I have thought of) so I can make it given to the player with an Ability. This would mean adding the SpellEffectStart lines, and can you contain that within a spell effect? I tried just using that script within a spell script, but I do not see a way to contain it within a spell.No, the best way to do that would be to have this script check for the presence of that ability. Wouldn't even need a script effect ability, you could just use any normal affect ability, as long as it's unique (so the script will only run if you want it to). Pretty sure it could be a script effect ability, but I'm not certain how those work exactly... Anyway, try this: scn PlayerWakeUp short WakeHour short doOnce Begin GameMode || MenuMode ;any time if ( player.IsSpellTarget, "your ability's ID" != 1 ) return endif end Begin MenuMode 1012 ;during Wait/Sleep if ( doOnce == 0 ) set WakeHour to ( GameHour + 1 ) set doOnce to 1 endif if ( GameHour >= Hour ) set doOnce to 0 WakeUpPC endif end Link to comment Share on other sites More sharing options...
Ramengelion Posted April 24, 2006 Author Share Posted April 24, 2006 Ah! Now you see? I didn't think of that. That is why I made a post on here. Thanks a lot, this was a real snag in my developments, the rest is NPC and Dungeon generation. EDIT: Acutally, now I think I spot a small flaw, would this be the correct script? Changes in bold scn PlayerWakeUp short WakeHour short doOnce Begin GameMode || MenuMode ;any time if ( player.IsSpellTarget, "ImmortalityAbility" != 1 ) return endif end Begin MenuMode 1012 ;during Wait/Sleep if ( doOnce == 0 ) set WakeHour to ( GameHour + 1 ) set doOnce to 1 endif if ( GameHour >= [b]Game[/b]Hour ) set doOnce to 0 WakeUpPC endif end Just the last "if" block is changed. EDIT2.0: For future reference, what modeling programs can be used for making models for Oblivion? EDIT2.5: Err... this script didn't work Link to comment Share on other sites More sharing options...
DragoonWraith Posted April 25, 2006 Share Posted April 25, 2006 Ah! Now you see? I didn't think of that. That is why I made a post on here. Thanks a lot, this was a real snag in my developments, the rest is NPC and Dungeon generation. EDIT: Acutally, now I think I spot a small flaw, would this be the correct script? Changes in bold scn PlayerWakeUp short WakeHour short doOnce Begin GameMode || MenuMode ;any time if ( player.IsSpellTarget, "ImmortalityAbility" != 1 ) return endif end Begin MenuMode 1012 ;during Wait/Sleep if ( doOnce == 0 ) set WakeHour to ( GameHour + 1 ) set doOnce to 1 endif if ( GameHour >= [b]Game[/b]Hour ) set doOnce to 0 WakeUpPC endif end Just the last "if" block is changed. EDIT2.0: For future reference, what modeling programs can be used for making models for Oblivion? EDIT2.5: Err... this script didn't workActually, no. That's I meant "WakeHour", neither Hour nor GameHour. Try that. Link to comment Share on other sites More sharing options...
Ramengelion Posted April 25, 2006 Author Share Posted April 25, 2006 Ah that might help. I have to make this a Quest script correct? EDIT: alright, but I used the script you gave me, made it a global script. Everything about it works except the effect that is desired. :P Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.