You are a brilliant person sir! (like I said in my post, I would give whoever wrote me a guide on scripting a lot of praise. and this is not because I am svcking up to you, but honestly, I cannot be thankful enough you would donate your time to do such.)
But I cannot withhold this cornerstone of scripting info from everyone, so that is why I am creating a new thread, as recommended by Dwip himself, so everyone can read for those who are not exactly the brightest at scripting (like me).
LESSON 1:
Spoiler
I'd go roughly in this order trying to puzzle things out:
1. Script types - Quest, Object, Magic Effect, quest stage, dialogue. Quest scripts are tied to quests, only run when that quest is running, but are available globally, as opposed to Object scripts, which are tied to objects (NPCs/weapons/armor/activators/etc), and only run when that particular object is actively loaded or referenced. Magic Effect scripts only work with spells. Quest stage and dialogue scripts only run one time when the quest stage or dialogue is triggered.
2. Blocktypes - I won't go into all of them here, but you should know how gamemode blocks work (by looping over and over - quests at 5 seconds by default, objects I think every frame). You won't use most of the others nearly as often.
3. Variables - shorts, floats, refs, and I think one other. Each type has a specific meaning (shorts are whole numbers, floats are decimal numbers, refs are object references), and can do just about anything. Doonce is a variable.
4. If/Else/Elseif/Endif - The building blocks of scripts. If CONDITION, do stuff, Elseif CONDITION do other stuff, Else do other stuff, ending with an Endif.
5. Basic Conditions - == (EQUAL TO), != (NOT EQUAL TO), > (GREATER THAN), < (LESS THAN), >= (GREATER THAN OR EQUAL TO), <= (LESS THAN OR EQUAL TO). Have a variety of uses, but typically used with condition functions like GetStage or GetIsID, or with variables like Doonce. When a script has something like "If Doonce == 1" it's saying to only run the code following it if Doonce has a value of 1 (because you set it to 1 using Set somewhere else). If it has a value of 0 or 2 (or whatever), it won't be true and the code won't run.
6. Complex Conditions - && (AND), and || (OR), which work like, say, "If Doonce == 1 && player.getitem gold001 >= 100". In that line, the code following the if would run only if both Doonce was equal to 1 AND the player had 100 or more gold. By contrast, "If Doonce == 1 || player.getitem gold001 >= 100" would run if either one of those conditions was true.
In the specific case of Doonce, it's usual method of usage is something like this:
In that bit of code, the script would run, adding 100 gold to the player, and on the next and all runs after, it would remove 100 gold from the player.
1. Script types - Quest, Object, Magic Effect, quest stage, dialogue. Quest scripts are tied to quests, only run when that quest is running, but are available globally, as opposed to Object scripts, which are tied to objects (NPCs/weapons/armor/activators/etc), and only run when that particular object is actively loaded or referenced. Magic Effect scripts only work with spells. Quest stage and dialogue scripts only run one time when the quest stage or dialogue is triggered.
2. Blocktypes - I won't go into all of them here, but you should know how gamemode blocks work (by looping over and over - quests at 5 seconds by default, objects I think every frame). You won't use most of the others nearly as often.
3. Variables - shorts, floats, refs, and I think one other. Each type has a specific meaning (shorts are whole numbers, floats are decimal numbers, refs are object references), and can do just about anything. Doonce is a variable.
4. If/Else/Elseif/Endif - The building blocks of scripts. If CONDITION, do stuff, Elseif CONDITION do other stuff, Else do other stuff, ending with an Endif.
5. Basic Conditions - == (EQUAL TO), != (NOT EQUAL TO), > (GREATER THAN), < (LESS THAN), >= (GREATER THAN OR EQUAL TO), <= (LESS THAN OR EQUAL TO). Have a variety of uses, but typically used with condition functions like GetStage or GetIsID, or with variables like Doonce. When a script has something like "If Doonce == 1" it's saying to only run the code following it if Doonce has a value of 1 (because you set it to 1 using Set somewhere else). If it has a value of 0 or 2 (or whatever), it won't be true and the code won't run.
6. Complex Conditions - && (AND), and || (OR), which work like, say, "If Doonce == 1 && player.getitem gold001 >= 100". In that line, the code following the if would run only if both Doonce was equal to 1 AND the player had 100 or more gold. By contrast, "If Doonce == 1 || player.getitem gold001 >= 100" would run if either one of those conditions was true.
In the specific case of Doonce, it's usual method of usage is something like this:
scn ExampleScript ; Comments are denoted by a semicolon. scn is short for scriptname - the name of the scriptshort Doonce ; you always have to define your variables, usually at the start of a scriptbegin gamemode ; blocktype. A gamemode block will run repeatedly if Doonce == 0 ; only run the following code if Doonce is equal to 0. Variables are 0 by default. player.additem gold001 100 ; Adds 100 gold to the player set Doonce to 1 ; sets Doonce to 1. The next time the script runs, Doonce will no longer be 0, and this part won't run again Else player.removeitem gold001 100 ; removes 100 gold from the player ; Because of the else, this only runs if Doonce is not 0 Endifend ; ends the block, but not the script. You could add more blocks after this if you wanted.
In that bit of code, the script would run, adding 100 gold to the player, and on the next and all runs after, it would remove 100 gold from the player.