skulll800 Posted January 10, 2017 Share Posted January 10, 2017 (edited) First I'd like to mention, I've tried doing it myself, but I don't really have the time to spend several hours training myself and learning how to use the construction kit, and I'm nearly out of spare time rn, hence why this might've been already explained on this forum. Now, my problem is rather simple, but I can't seem to find a quick solution to it by simply searching several key fragments of the script. To the point, I'm currently using a mod that adds a ring to your character automatically and, wether equipped or not, if selected and used on your char in your inventory you're teleported automatically to a room, it's only usable in Seyda Neen, the room itself holds one bed, nine trainers who together can train you every single skill, a chest that adds or subtracts gold from your char, and a chest with empty scripts intended to be edited. The mod works perfectly, had no issues at all (rather unusual in my experience), only problem I'm having is figuring out how to properly edit the custom scripts and make it run the console commands I want it to run when I use them ingame. The commands are simple, I want to be able to maximize (set to 100) the skills (athletics, enchant, spear) my character has, the abilities (strength, int. , speed, ...), and set my level to 800, mostly for testing purposes with certain quests and creatures. I'd like to be able to run all these commands in one button (the chest makes use of "buttons" that when pressed activates the script connected to the respective button), if possible, if not I'll figure it out myself or just revert to simply using the console. The mod in question is here = http://www.nexusmods.com/morrowind/mods/44553/? The furthest I've gotten is somehow managing to open the construction set without the application crashing (it did during earlier attempts on a different computer) and finding what I assume is very likely the chest from the mod, double clicking it wich opens a window wich along with other options gives me the option to what I think is the script I need to edit to make this happen, wich is the following ____________________________________________________________________set button to getbuttonpressedif (button==-1)returnelseif (button==0)set controlvar to 0startscript zzzLevelBoosterScript1elseif (button==1)set controlvar to 0startscript zzzLevelBoosterScript2elseif (button==2)set controlvar to 0startscript zzzLevelBoosterScript3elseif (button==3)set controlvar to 0startscript zzzLevelBoosterScript4elseif (button==4)set controlvar to 0startscript zzzLevelBoosterScript5elseif (button==5)set controlvar to 0startscript zzzLevelBoosterScript6elseif (button==6)set controlvar to 0startscript zzzLevelBoosterScript7elseif (button==7)set controlvar to 0startscript zzzLevelBoosterScript8elseif (button== :cool:set controlvar to 0endifendif end____________________________________________________________________ I think that's about it, tried to give as much info as I could to avoid dragging this out to much, I hope it's not to much of a hassle for someone to help me with this (or to correct me if I happen to be in the wrong section). Edited January 10, 2017 by skulll800 Link to comment Share on other sites More sharing options...
Ferren42 Posted March 16, 2017 Share Posted March 16, 2017 From what I see in the script, there are several issues, though I'm not sure if any of them contribute to your problem. First, operators and such should be separated by spaces, ie "if (button==-1)" should be "if ( button == -1 )" I've heard that not having spaces can mess up the scripting. Second, the script does not appear do have a name. The first line should always be "Begin myscript" where myscript is the name of the script. Third, you are using (I'm assuming) controlvar and button as short variables, that is a variable which can contain a number to be referenced later. You should check to see controlvar is a global variable by clicking on Gameplay in the toolbar, then Globals... and scrolling to the c's to see if controlvar is listed. If not, you need to declare that controlvar is a variable in the script. If the number is only used in this script, which I'm assuming not since the script does not reference it, only modifies it, you would put "short controlvar" on a line near the top. If it is a variable which needs to be referenced by another script, you should instead include "float controlvar" near the top. Button should also be stated with "short button" near the top. If controlvar is a global, it's possible that another mod is causing conflict with it, as I imagine controlvar could be a popular name for a variable. Fifth, you need a message box to provide the buttons pushed for the script, see the example below. Finally to make the script easier to read, I recommend using indents to seperate if statements from effects, ie.if ( button == -1 ) returnelseif ( button == 0 ) set controlvar to 0 startscript zzzLevelBoosterScript1elseif ( button == 1 ) etc...See below for more involved indenting. I'm fairly new to scripting myself, so if this is useless, I'm sorry. Also, if I said something wrong, I'm very sorry and hopefully someone could correct me.Here's a similar script to this one as far as button pushing goes from GhanBuriGhan's script tutorial, it may help you fix a few things.----------------------------------------------------------------Begin my_first_scriptShort controlvarShort buttonFloat timerIf ( MenuMode == 1 ) ReturnEndifIf ( OnActivate == 1 ) If ( controlvar == 0 ) MessageBox "Voiceless it cries, wingless flutters, toothless bites, mouthless mutters. What is it?", "Bat", "Old woman", "Wind", "Wraith" Set controlvar to 1 elseif controlvar > 1 activate endifendifif ( controlvar == 1 ) set button to GetButtonPressed if ( button == -1 ) return elseif ( button == 2 ) MessageBox "The answer was correct" Activate set controlvar to 2 else MessageBox "The answer was wrong" Player -> AddSpell, "Frost_Curse" set controlvar to –1 Endifelseif ( controlvar == 2 ) Activate Set controlvar to 3elseif ( controlvar == -1 ) Set timer to ( timer + GetSecondsPassed ) if timer > 10 Player -> RemoveSpell, "Frost_Curse" set controlvar to -2 endifendifEnd------------------------------------------------------------------------- Link to comment Share on other sites More sharing options...
Recommended Posts