Help - Search - Members - Calendar
Full Version: Just Newbie in scripting...
The Nexus Forums > Specific Games > Oblivion > General Oblivion > General Oblivion
Anthony Xiii
Can someone help me in this? I just want to know how i summon my custom companion? smile.gif
LoginToDownload
Go under Gameplay/Edit Scripts. Open a new script, and select "Magic Effect" from the drop-down box. The text itself should go something like this...

CODE
scn MySummonCompanionScript
;The script's name

Begin ScriptEffectStart
;ScriptEffectStart will run when the effect first kicks in.  ScriptEffectUpdate runs every frame the effect is active, and ScriptEffectFinish when it ends.
CompanionRef.MoveTo player
end


To go with this, create a new spell. It should have one "Script Effect" magic effect, work on self with no duration, and use your new script. (If it doesn't show up as an option, it means it's not a "Magic Effect" script) If you want, you can apply visual effects. I'll leave giving the player the spell up to you, if it's okay.
Anthony Xiii
Heya! i dunno what is wrong in this script:
Idea is when starting game, i pull a lever and if I'm mage, i get a letter and a key to Arcane University Mage trainer's house.

CODE
Scn AUGuestScript

Short doOnce

begin OnActivate
if GetIsClass == Mage
if ( doonce == 0 )
player.additem AUMageKey
player.additem AUMageLetter
setdoOnce to 1
endif
endif
end


And thanks.gif for helping me!
LoginToDownload
The problem there seems to be that you seem to be asking whether the lever is a mage or not, there should be a space in "Set DoOnce to 1", and the syntax seems to be wrong on GetIsClass. Try this... Alterations capitalized for reference.

CODE
Scn AUGuestScript
short doOnce
REF LEVERPULLER

Begin OnActivate
     SET LEVERPULLER TO GETACTIONREF
     IF LEVERPULLER.GETISCLASS MAGE
;The game reads this as "If LeverPuller.GetIsClass Mage != 0"
          if (doonce == 0)
               player.AddItem AUMageKey
               player.AddItem AUMageLetter
              ;you could also use LeverPuller.AddItem, or enable existing (disabled) key and letter
              ;references above the lever so it looks like they're falling through a trapdoor or such.
               SET DOONCE TO 1
          endif
     endif
end
Anthony Xiii
Can you tell me how to add buttons to the "messagebox: ..." script? I've been trying to put a script on item mold, so for example when I press the mold: "messagebox: How many silver forks would you like to make?" Buttons: 2, 1, Nothing, so thats the problem, I can't put a buttons to messagebox. confused.gif
Anthony Xiii
QUOTE(LoginToDownload @ Jun 6 2008, 02:48 PM) *
The problem there seems to be that you seem to be asking whether the lever is a mage or not, there should be a space in "Set DoOnce to 1", and the syntax seems to be wrong on GetIsClass. Try this... Alterations capitalized for reference.

CODE
Scn AUGuestScript
short doOnce
REF LEVERPULLER

Begin OnActivate
     SET LEVERPULLER TO GETACTIONREF
     IF LEVERPULLER.GETISCLASS MAGE
;The game reads this as "If LeverPuller.GetIsClass Mage != 0"
          if (doonce == 0)
               player.AddItem AUMageKey
               player.AddItem AUMageLetter
             ;you could also use LeverPuller.AddItem, or enable existing (disabled) key and letter
             ;references above the lever so it looks like they're falling through a trapdoor or such.
               SET DOONCE TO 1
          endif
     endif
end


By the way, when im trying to save this script it says:
CODE
Script 'AUGuestScript', line 10:
Missing parameter Count.
Compiled script not saved!

Continue playing?
...

What should I do?
Anthony Xiii
QUOTE(Anthony Xiii @ Jun 8 2008, 06:02 PM) *
QUOTE(LoginToDownload @ Jun 6 2008, 02:48 PM) *
The problem there seems to be that you seem to be asking whether the lever is a mage or not, there should be a space in "Set DoOnce to 1", and the syntax seems to be wrong on GetIsClass. Try this... Alterations capitalized for reference.

CODE
Scn AUGuestScript
short doOnce
REF LEVERPULLER

Begin OnActivate
     SET LEVERPULLER TO GETACTIONREF
     IF LEVERPULLER.GETISCLASS MAGE
;The game reads this as "If LeverPuller.GetIsClass Mage != 0"
          if (doonce == 0)
               player.AddItem AUMageKey
               player.AddItem AUMageLetter
            ;you could also use LeverPuller.AddItem, or enable existing (disabled) key and letter
            ;references above the lever so it looks like they're falling through a trapdoor or such.
               SET DOONCE TO 1
          endif
     endif
end


By the way, when im trying to save this script it says:
CODE
Script 'AUGuestScript', line 10:
Missing parameter Count.
Compiled script not saved!

Continue playing?
...

What should I do?


Sorry about that, you know, I'm kinda noob in scripting, so the problem was in the count:
CODE
player.AddItem AUMageKey 1*
player.AddItem AUMageLetter 1*
Just only problem i have now is the messagebox buttons what i said before. (I'm from Finland, sorry my english)
LoginToDownload
QUOTE
player.AddItem AUMageKey 1*player.AddItem AUMageLetter 1*

Whoops... I always make that mistake until the CS catches it... sweat.gif

The format for messageboxes goes...
CODE
"message", variable 1, variable 2, ... variable 9, "option 1", "option 2", ... "Option 10"

In this case the script would be...
CODE
messagebox "How many silver forks would you like to make?" "2", "1", "Nothing"

The Construction Set Wiki has a full list of fuctions and how they work. I find it an incredibly useful reference.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.