Scripting: So theirs no "Begin GameMode" function?

Post » Tue Jun 19, 2012 1:04 am

So if this function has truly been removed, whats replaced it?

:ermm:
User avatar
Kristina Campbell
 
Posts: 3512
Joined: Sun Oct 15, 2006 7:08 am

Post » Tue Jun 19, 2012 1:38 am

http://www.creationkit.com/Differences_from_Previous_Scripting#Replacing_GameMode
User avatar
Shirley BEltran
 
Posts: 3450
Joined: Wed Jul 26, 2006 4:14 pm

Post » Mon Jun 18, 2012 11:10 pm

From the wiki: http://www.creationkit.com/Differences_from_Previous_Scripting#Replacing_GameMode

Cipscis
User avatar
DAVId Bryant
 
Posts: 3366
Joined: Wed Nov 14, 2007 11:41 pm

Post » Tue Jun 19, 2012 3:12 am

The page linked to above doesn't consider http://www.creationkit.com/RegisterForSingleUpdate_-_Form.

You might consider that as well as it has advantages in some situations.
User avatar
Skrapp Stephens
 
Posts: 3350
Joined: Mon Aug 06, 2007 5:04 am

Post » Mon Jun 18, 2012 6:50 pm

Nope OnUpdate still doesn't address the issue.
User avatar
Kate Norris
 
Posts: 3373
Joined: Mon Nov 27, 2006 6:12 pm

Post » Mon Jun 18, 2012 4:39 pm

Nope OnUpdate still doesn't address the issue.
What issue?

ScriptName YourScript extends WhateverEvent OnInit()	RegisterForUpdate(5) ; equivalent to (fQuestDelayTime == 0)/SetQuestDelay to 0EndEventEvent OnUpdate() ; 'GameMode block'	; Do stuff every five secondsEndEvent
User avatar
Anna Krzyzanowska
 
Posts: 3330
Joined: Thu Aug 03, 2006 3:08 am

Post » Mon Jun 18, 2012 8:01 pm

What issue?

ScriptName YourScript extends WhateverEvent OnInit()	RegisterForUpdate(5) ; equivalent to (fQuestDelayTime == 0)/SetQuestDelay to 0EndEventEvent OnUpdate() ; 'GameMode block'	; Do stuff every five secondsEndEvent

Trying to recreate a "begin GameMode" script.

I tried using OnInit but when it came to using that command to add items it always added double for some reason.
User avatar
Chris Duncan
 
Posts: 3471
Joined: Sun Jun 24, 2007 2:31 am

Post » Tue Jun 19, 2012 1:54 am

Quest? Untick "Start Game Enabled"? OnInit() Event will run once just the same.

ScriptName YourScript extends QuestArmor Property YourARMO AutoEvent OnInit()	If !Game.GetPlayer().GetItemCount(YourARMO)		Game.GetPlayer().AddItem(YourARMO, 1)	EndIfEndEvent
User avatar
Lily Something
 
Posts: 3327
Joined: Thu Jun 15, 2006 12:21 pm

Post » Mon Jun 18, 2012 11:08 am

Quest? Untick "Start Game Enabled"? OnInit() Event will run once just the same.

Lol it does that?

That should be on a bugs warning page or something...

Thanks will try it.

:D
User avatar
Felix Walde
 
Posts: 3333
Joined: Sat Jun 02, 2007 4:50 pm

Post » Mon Jun 18, 2012 12:13 pm

It's mentioned already on the http://www.creationkit.com/OnInit page, although it wasn't particularly clear.

I've made an edit that hopefully makes it clearer.

Cipscis
User avatar
FABIAN RUIZ
 
Posts: 3495
Joined: Mon Oct 15, 2007 11:13 am

Post » Mon Jun 18, 2012 2:15 pm

It's mentioned already on the http://www.creationkit.com/OnInit page, although it wasn't particularly clear.

I've made an edit that hopefully makes it clearer.

Cipscis

Thanks for help already got it working as required however.

:biggrin:
User avatar
Dina Boudreau
 
Posts: 3410
Joined: Thu Jan 04, 2007 10:59 pm

Post » Mon Jun 18, 2012 4:41 pm

For this reason I generally like to do something like this:

if (!initialized)   initialized = true   RegisterForUpdate(0.5)endif
User avatar
Timara White
 
Posts: 3464
Joined: Mon Aug 27, 2007 7:39 am

Post » Mon Jun 18, 2012 3:12 pm

On that note, it's good to be aware of a new feature in Papyrus that can be used for a similar purpose as such initialisation variables - http://www.creationkit.com/States_(Papyrus)

Cipscis
User avatar
Sian Ennis
 
Posts: 3362
Joined: Wed Nov 08, 2006 11:46 am

Post » Mon Jun 18, 2012 11:36 am

On that note, it's good to be aware of a new feature in Papyrus that can be used for a similar purpose as such initialisation variables - http://www.creationkit.com/States_(Papyrus)

Cipscis

States is something I would use when I want scripts to get even more creative :cool:
User avatar
Syaza Ramali
 
Posts: 3466
Joined: Wed Jan 24, 2007 10:46 am


Return to V - Skyrim