How to make a script work at game start?

Post » Fri Nov 16, 2012 5:42 pm

I want that my script start when game begins. The script has a state, I want the player to be in it immediately.
But I don't know how to do this! What this script should extend? ot must it be hidden? or what?

Also I want to add a spell when player loads/starts the game, same problem, I know not how.
User avatar
Maria Garcia
 
Posts: 3358
Joined: Sat Jul 01, 2006 6:59 am

Post » Fri Nov 16, 2012 9:11 pm

I would create a quest that starts with game. Then you can attach any scripts you want and put the player in an Alias.
User avatar
Alyna
 
Posts: 3412
Joined: Wed Aug 30, 2006 4:54 am

Post » Fri Nov 16, 2012 6:23 pm

Attaching this to the quest script will also add a spell to the player if they don't already have the spell.
SPELL Property MySpell AutoEvent onInit()if !Game.GetPlayer().HasSpell(MySpell)Game.GetPlayer().AddSpell(MySpell)endifEndEvent
User avatar
Emmanuel Morales
 
Posts: 3433
Joined: Sat Oct 06, 2007 2:03 pm

Post » Fri Nov 16, 2012 2:26 pm

Once you have a script that is run when a new game is started, you can add a spell with the following lines:

Spell Property NameOfYourSpell Auto

Game.GetPlayer().AddSpell(NameOfYourSpell)

Just remember to set the correct spell in the script's Properties window.

EDIT: I was too slow.
User avatar
Romy Welsch
 
Posts: 3329
Joined: Wed Apr 25, 2007 10:36 pm

Post » Sat Nov 17, 2012 4:09 am

Thanks mates
User avatar
Lilit Ager
 
Posts: 3444
Joined: Thu Nov 23, 2006 9:06 pm


Return to V - Skyrim