Jump to content

Cant figure out why this script isnt working.


thelawfull

Recommended Posts

Need to make a spell that shows race menu I have it added to a spell but when the spell casts it crashes to desktop

So to fix it I made a delay script but it doesnt seem to be working.

 

scn tlsredesignspellscript

float Timer

begin gamemode
set timer to .03 GetSecondsPassed
if timer >= .03
Showracemenu
Endif

End

 

Help is appreciated.

Link to comment
Share on other sites

First of all, you might need to do a lot more than that if you want to allow editing player's face with ShowRaceMenu - at least if the process needs to account for all the same pitfalls as the console version. You can read more here on the UESP Wiki (scroll to the ShowRaceMenu notes): http://www.uesp.net/wiki/Oblivion:Console#Other_Commands

 

Spell effect scripts use ScriptEffectUpdate that is equivalent to GameMode, but only runs when the spell is active (and apparently might begin running immediately, so you might need something to control the flow if you use both ScriptEffectStart and ScriptEffectUpdate). For a single command you could use, for example, either the start or finish blocks.

Begin ScriptEffectStart
    ; start
End

Begin ScriptEffectFinish
    ; end
End

Begin ScriptEffectUpdate
    ; GameMode equivalent
End

Timers could work like this (as an approximate example):

float fTimer

Begin ScriptEffectStart

    set fTimer to 0.5
    ; OBSE equivalent --> let fTimer := 0.5

End

Begin ScriptEffectFinish
    ; if you use Dispel in ScriptEffectUpdate, place this BEFORE it
End

Begin ScriptEffectUpdate

    set fTimer to fTimer - GetSecondsPassed
    ; OBSE equivalent --> let fTimer -= GetSecondsPassed

    If ( fTimer > 0 )
        Return
    EndIf

    MessageBox "Timer finished!"

    Dispel ThisSpellHere  ; double-check this before use --> http://cs.elderscrolls.com/index.php?title=Dispel

End

In general, the Construction Set wiki should have lots of info available. You can read some of the tutorials there, it will save you a lot of waiting when you can just write it all yourself and no longer need to ask others: http://cs.elderscrolls.com/index.php?title=Portal:Scripting

 

If someone spots any mistakes in my post, please correct, I have no means to test at the moment, and I seem to produce mistakes on an almost industrial scale. :laugh:

 

Edit: I hope that helps a little. Also added the missing UESP link that I initially forgot. Sorry. :blush:

Edited by Contrathetix
Link to comment
Share on other sites

Good point, Theres plenty of mods that allow it and I should let people find them along with my dementia mod, Basically it sets the player level back to 1 and opens the class menu so everything can start to square 1. That way people can keep all there quest items and start new without starting a new game, Then I thought people would need then to change there race and birthsign if they wanted to start a new charecter completely. But the mod works and makes sense as it is and my hope is that people will realize they can use it alongside something else. Im sorry for having you do the work but I was busy and theres no delete button. Please disregard this post and I apologize.

 

Here is the link to the mod

http://www.nexusmods.com/oblivion/mods/47146/?

Edited by thelawfull
Link to comment
Share on other sites

No problem, that was really no work at all, mostly typing. And it was mainly a tip, as in "if you do not want to wait, do it yourself". It has taken me years to learn, and I am still learning new, but the ultimate reward is to be able to try all sorts of things as soon as the Construction Set boots up, without the need to ask on an online forum and wait for a response. But on the other hand, asking is a great way to learn, too. :smile:

 

Now that I saw your mod, it actually makes sense to have stuff reset. I was thinking about a face revamp, but that "Dementia" mod actually can do with a little... dementia. Good luck with the project. :thumbsup:

Edited by Contrathetix
Link to comment
Share on other sites

It reminds me of this book a read when merlin hit his head on a rock and forgot all his spells and had to start over, Its good the way it is and leave it the way it is cause theres already a necklace mod that changes race without effecting anything. Thankyou and happy modding to you to aswell :)

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...