erican_lord Posted August 6, 2009 Share Posted August 6, 2009 Ok This Is My Script So Far:scn 00AyleidPlatformactivator Short Activated Short Move Float Timer Begin GameMode If Activated == 0 If GetPos.MovePlatformRef Z, -130.7862 Set Activated == 1 Else If GetPos.MovePlatformRef Z, -373.7862 Set Activated == 2 Endif Endif Endif End Begin OnActivate If Activated == 1 SetPos.MovePlatformRef Z, -373.7862 Set Activated == 0 Elseif If Activated == 2 SetPos.MovePlatformRef Z, -130.7862 Set Activated == 0 Endif Endif End And I Want To Know IIf This Is Right. The Starting Position For The Platform Is -130.7862 for Z i want it to be like this: I Press The Button And IT Checks To See If It Is At Position 1 (-130) or Position 2 (-373) and if its at -130 i want it to go on a timer to where it goes down/up at the same speed the ayleid hidden doors open. (you know the ones where u press a button and they go down slowly, and exaple is in Aran Mathi) If It Is At Position 1 then it moves to position 2, if its at position 2 it moves to position 1. I Just Dont Want It To Go Right Away. That Is Why I Want A Timer on it. I Need To Know What Else I Need To Add to make this Work. I Know Im Missing The Timer But Am I Missing Anything Else? Please Reply ASAP thanks!! Link to comment Share on other sites More sharing options...
David Brasher Posted August 6, 2009 Share Posted August 6, 2009 I am rather new to scripting, and have not tried a script to do something like what you are doing yet, but I do see one repeated problem. Set Activated == 1 The syntax should be: Set Activated to 1 Do not be confused by the fact that the following is correct: If Activated == 0 Elses and ElseIfs can be confusing and treacherous. I do not know how to advise you on them. I can warn you that there is a glitch in the CS where an improper ElseIf will make the CS refuse to save a script, but not give you an error message. I suggest that you type in your script and attempt to apply it to your mod. The auto-debug will let you know if anything is totally unacceptable. (It will also refuse to save a script with detectable bugs.) You can comment out any defective lines with the semicolon. Ex: ;If Defective Rotten Code Then Gosub 400 Next X Then you can save your script and fix it later when you figure out how. A partially functional script active in the game will give you great insights and guide your direction. Link to comment Share on other sites More sharing options...
Khet Posted August 6, 2009 Share Posted August 6, 2009 Erican - Check your original post on this subject. I replied to it before I seen this one. Also, with your current script there are some major errors. I'll point out the main ones. Note: See last line of post for short version. Set Activated == 0 This should be Set Activated to 0. Only times you use ==, !=, <=, >= and any other variants are during and If or ElseIf check. SetPos.MovePlatformRef Z, -373.7862 SetPos.MovePlatformRef Z, -130.7862 these two are also wrong. What'll happen is the first time your script runs it will move the ref down by 373, when it's activated again, the ref will move DOWN again but this time by another 130 (for a total of 403) That is why in my replies to your other thread I called up the GetPos command and then modified the Pos variable accordingly. If you want it to move down, then up (back to it's original position) you would need to have a negative version (SetPos.Ref Z, -100) and then to and then one to set it back up to it's original position. (SetPos.Ref Z, +100) With that, the first time the script runs the platform will move down by 100 units, then the second time it will move UP by 100 units (in otherwords, back to it's starting position) Also, the way your script is set up now your Timer doesn't do anything. Now, I forget if SetPos is instant or makes the object 'float' to its new position, but I'll be using a similar script soon myself (again, that's for sparking the idea mate!) and I'll get back to you asap on a working version. Finally, you never use the Move variable so there's no need for it. In short, your script won't run the way you want. Link to comment Share on other sites More sharing options...
Recommended Posts