Difference between revisions of "Talk:AddPerk"

Jump to navigation Jump to search
932 bytes added ,  14:00, 16 April 2009
m
→‎Codearound: book version here: simple version in article.
imported>DewiMorgan
m (→‎Codearound: Ooh, good ideas :))
imported>DewiMorgan
m (→‎Codearound: book version here: simple version in article.)
Line 12: Line 12:


:::I like the idea of a book, though - using is much more intuitive than dropping, and it means you can drop it and leave it at home, rather than having to carry the stupid thing around with you. A proper version would have menus and stuff, but I'm aiming here for the simplest possible system, so that people can build on it.
:::I like the idea of a book, though - using is much more intuitive than dropping, and it means you can drop it and leave it at home, rather than having to carry the stupid thing around with you. A proper version would have menus and stuff, but I'm aiming here for the simplest possible system, so that people can build on it.
::: Because I'm aiming for simple, I went for the simplest suggestion: however, a book version is below if desired. [[User:DewiMorgan|DewiMorgan]] 19:00, 16 April 2009 (UTC)
First, a BOOK-type item called "ExampleBook", with an Object-type script like the following is created:
    ScriptName ExampleTokenScript
   
    Begin OnEquip player
        If player.HasPerk ExamplePerk
            player.RemovePerk ExamplePerk
            Message "ExamplePerk Disabled - mod is now safe to remove."
        Else
            player.AddPerk ExamplePerk
            Message "ExamplePerk Enabled - don't uninstall this mod without disabling!"
        EndIf
    End
Then a quest called "ExampleQuest" is created and set to "start game enabled", with a Quest-type script:
    ScriptName ExampleQuestScript
   
    Begin GameMode
        player.AddItem ExampleBook 1
        player.AddPerk ExamplePerk
        StopQuest ExampleQuest
    End
Anonymous user

Navigation menu