white_dragoon_x Posted December 24, 2008 Share Posted December 24, 2008 please help if you can so here is my issue. i wanted to make a new workbench that would make custom schematics that i have made so i used the workbench script file as a base so i would only have to tinker with a few things to make it work (in other words do it the easy way because im no scripter). but i keep running into an error and cant save my file the error says that there is something wrong with the use of if/else/endif saying its in the wrong place but i know that cant be true because that particular "if" that it is referring to was in the original script. the script said "if button == 1" so i deleted that line and it saved but i found another problem that happens in game. when i enter the room that has my custom workbench it just keeps popping up the message saying i cant create that weapon and every time i hit "ok" it pops it again. and it happens before i even interact with the bench. so if you can understand what im trying to say because i have a hard time getting my point across when it comes to problems. any help would be appriciated. Link to comment Share on other sites More sharing options...
Khet Posted December 24, 2008 Share Posted December 24, 2008 Simple mistake with new scripters. For every If command you need to have an EndIf at the END of your block. Furthermore, you also need an End at the end of your Begin block. If you recieve the If/else/EndIf error, keep adding one more EndIf until it stops popping up. As for it popping up, you used Begin GameMode instead of Begin OnActivate. GameMode means it will be constantly running as long as the object is loaded (you're in the cell) OnActivate will only run ONCE each time the player activates the bench. Edit: To clarify, here's a few examples of what I mean. scn ScriptName Short Var1 Short Var2 Short Var3 Short Var4 Begin GameMode;This will run every five seconds when object is loaded (in same cell) If Var1 == 0 Set Var2 to 1 EndIf End Begin OnActivate;This runs every time the object is activated, along with the first block If Var3 == 0 && Var4 == 0 Set Var3 to 1 ElseIf Var3 == 1 && Var4 == 0 Set Var3 to 0 Set Var4 to 1 ElseIf Var3 == 0 && Var4 == 1 Set Var3 to 0 Set Var4 to 0 EndIf End Rough example, but you get the point. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.