Welcome Guest [Log In] [Register]
Add Reply
Can I help with scripting?; Some scripting i've done
Topic Started: Jul 21 2008, 03:55 PM (37 Views)
Pwin
Member Avatar
Novice
[ * ]
This is a script I wrote up for the mod Advanced Herbalism. And yes, I do document all my code this much. xD I have a horrible memory for coding, so I have to do this lol. :)

Code:
 
Begin jjs_Set_Herbalism
;This script is meant to set the Herbalism skill at the end of character creation.
;This makes your starting Herbalism skill based off of your knowledge of plants (Int / 5) and
;also your perseverance (willpower / 10).

;Working on having the script start automatically right after chargen. Currently has to be called by console.
short BaseInt ;Intelligence
short BaseWill ;Willpower
short Modifier

if ( MenuMode == 1 )
Return
elseif ( CharGenState != -1 ) ;this means chargen is not done
Return
elseif ( "jjs_done_setup" == 1 ) ;Prevent this script from running more than once
Return ;This currently does not work properly and prevents the script from running.
endif

set BaseInt to player->GetIntelligence ;Get players intelligence and store in BaseInt
set BaseWill to player->GetWillpower ;Get Players willpower and store in BaseWill

set Modifier to ( ( BaseInt / 5 ) + ( BaseWill / 10 ) ) ;Intelligence for knowledge of plants, Willpower for determination and focus


Set Herbalism to ( Herbalism + Modifier ) ;Base Herbalism is 5, 5 + Modifier
Set HerbalismStored to ( HerbalismStored + Modifier )

; Messagebox "Herbalism set to %g" Herbalism
; Messagebox "HerbalismStored set to %g" HerbalismStored
Set jjs_done_setup to 1

StopScript jjs_Set_Herbalism


End jjs_Set_Herbalism


I'm a scripting newbie but I learn fast enough and do have some programming background (Vb and C++).

I was asked if I could look into some scripting for radiant AI a la LCV. I know how LCV works for the most part, even if I don't like how it was done. So I'm looking into how MCA prevents npcs from dissapearing when another script is working on them (ex. vampire embrace and the request mod).
Offline Profile Quote Post Goto Top
 
Sabian
Operative
[ *  *  * ]
excellent. Thanks Pwin!

Really glad you're here to help us with this!
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Showcase · Next Topic »
Add Reply