Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Auto add to inventory


Beana
 Share

Recommended Posts

You will need to make a quest and add a script to it, something like this :hugs:

Scriptname aaAddItem

Short DoOnce

Begin GameMode
If (DoOnce == 0)
;Add your items
Player.AddItem YourItemID

;Stop it from running again
Set DoOnce to 1
Endif

;If you want to stop a no longer needed quest add this
StopQuest YourQuestID
End[/code]

Just replace where it says YourItemID with the CS ID of your object(s), Same with the QuestID if you want to stop the quest from running once you have your item(s)

Link to comment
Share on other sites

Ok here's my process.. I made a new quest. Then I made the script which looks like yours.. It saves. I go back into Character>Quest>My quest to add the script I just made but its not appearing in the list. Now if I fiddle and chose "edit" I can find the quest and its listed with the word (DUPLICATE) after it. :hugs:

You can tell me to shut it and go take the rest of the scripting classes since I only finished the first one :)

Link to comment
Share on other sites

i've had this issue... i think i saved the script as a Magic Effect instead of Object... in your case, i think it should be "Quest"

theres that drop down box, with Object, Magic Effect and Quest..

Choose quest and resave it... and it should show up in your quest list.

EDIT:

as for the DUPLICATE, it means that there is another script saved with the same name, iirc (i've had this issue many times)

Link to comment
Share on other sites

I did not chose Quest. Now I did. Thanks!!! :)

I redid the entire process and I am getting an error.


scn aaBeanQuest


short doonce


begin gamemode


if (doonce == 0)

	player.additem "AAA1" 1

	player.additem "AAA2" 1

	player.additem "AAA3" 1

	player.additem "AAA4" 1

	player.additem "AAA5" 1

	player.additem "AAA6" 1

	StopQuest aaBeanQuest

	set doonce to 1

endif


end

This is exactly what I put in and I get an error saying... Mismatched begin/end on line 5 :hugs:

Link to comment
Share on other sites

Thats odd... I copied that script and pasted it directly into a test esp i have... and it saved right away (after creating fake aaa# and the quest)

Line 5 would be the "Begin gamemode" and you have the End for it and also the Endif

I would comment it all out, and retype it up, just to give it a shot, in case its a bad fluke

Link to comment
Share on other sites

scn aaBeanQuest


short doonce


begin gamemode


if (doonce == 0)

        player.additem "AAA1" 1

        player.additem "AAA2" 1

        player.additem "AAA3" 1

        player.additem "AAA4" 1

        player.additem "AAA5" 1

        player.additem "AAA6" 1

endif        

StopQuest aaBeanQuest

        set doonce to 1

end


Changed it to this and now it works.. I needed to add the endif after adding the player items.. then end at the end. I hope thats right?

Link to comment
Share on other sites

I asked about placing this here as not to clutter up the forum with another DoOnce question, so here goes...

I learned a bit about the DoOnce here, but I'm a little lost on how to place a DoOnce command for this script.

Where would I place the "..." at?

"If DoOnce == 0"

AND

"Set DoOnce to 1"



scriptname MalamathLetThereBeLightScript


Short DoOnce

short light

float timer


Begin OnActivate Player


	if ( light == 0 )

		LightStoneReal.Enable

		set timer to 3

		set light to 1

	endif

End


Begin GameMode


if ( light == 1 )

		if ( timer > 0 )

		set timer to timer - GetSecondsPassed

			else

				LightStoneReal.Disable

				LightStoneLeft.Enable

				LightStoneRight.Enable

				LightsOnMalamath02.Enable

				PlaySound MalamathLightStone

				set light to 2

		endif

endif


End


Thank You

Link to comment
Share on other sites

I asked about placing this here as not to clutter up the forum with another DoOnce question, so here goes...

I learned a bit about the DoOnce here, but I'm a little lost on how to place a DoOnce command for this script.

Where would I place the "..." at?

"If DoOnce == 0"

AND

"Set DoOnce to 1"



scriptname MalamathLetThereBeLightScript


Short DoOnce

short light

float timer


Begin OnActivate Player


	if ( light == 0 )

		LightStoneReal.Enable

		set timer to 3

		set light to 1

	endif

End


Begin GameMode


if ( light == 1 )

		if ( timer > 0 )

		set timer to timer - GetSecondsPassed

			else

				LightStoneReal.Disable

				LightStoneLeft.Enable

				LightStoneRight.Enable

				LightsOnMalamath02.Enable

				PlaySound MalamathLightStone

				set light to 2

		endif

endif


End


Thank You

Could you please explain what this script is supposed to do and what part of that should happen only once?

Link to comment
Share on other sites

Unless I'm missing something your script already has a DoOnce type condition built in.

The Activate section will only run on the first activation. Since it only does anything if Light == 0 then it sets Light to 1.

Further the Gamemode block only runs if Light == 1, then when it's done it sets it to 2.

Your script will effectivly disable itself after the first run since it's If conditions will return false.

Link to comment
Share on other sites

'DoOnce' is a variable name. It does the same thing no matter what you call it. You can call it 'light' or 'DoNothing' or even 'aabb1' if you want.

A variable name is just a bucket that holds a 'value'.

The 'IF' checks the bucket for a certain value. If its found, it executes whats inside the IF/ENDIF section. Otherwise, it skips the whole IF/ENDIF section.

Dont get stuck on it being called 'DoOnce'. We use that name because its 'descriptive' of what the variable is used for.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...