Jump to content

Saving Script Problem


LegoManIAm94

Recommended Posts

I made this script then I went to update it and saved it but when I click the X in the corner it says Do you want to save the current script? Yes No. When I click yes it will save but when I click on the X again it gives me the same message. When I click No it will exit the script window but not save my work even if I saved it by clicking the floppy disk.
Link to comment
Share on other sites

That sounds to me like you ran into an error in the script when you tried to save. The CS will NOT save a script that it cannot compile.

 

For that reason, when working with large or complex scripts, or when making a lot of changes, it is a good idea to actually write the script in a text editor, then paste into the script editor in the CS. That way if there is an error and you can't save, you can go back to the original and figure out what was wrong.

Link to comment
Share on other sites

The CS hates "ElseIf" and often does what you describe to scripts that use it. But there could be lots of other possibilities.

 

I suggest that you comment out parts of your script until you can isolate the bad line. Just make lots of semicolons like this:

 

 

SCN AAMyTroubledScript

Short Patience
Short DoOnce
Short GnarlyVar

Begin GameMode

;
;
;If GetGarbage commands nonfunctional == 3
;	 For X = 1 to 500
;Next 
;Pi R Square @ $rtsdsj
;00101010100010
;ElseiF
;	  Scary Monster attack now
;Goto 999
;GoSub
;REM This script isn't working right.
;
;
;	 EndIf
End

Link to comment
Share on other sites

Here is the script. I do have alot of endifs but I was wondering if I just slit it up into two to three scripts will that help?

 

scn 1weathercontrolc

short weatherc

begin gamemode

if (player. getinworldspace tamriel ==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	if (player. getpos z >= 5000)
		setweather snow 1
	elseif 
		setweather rain 1
	endif
elseif (weatherc==6)
	if (player. getpos z >= 5000)
		setweather snow 1
	elseif 
		setweather thunderstorm 1
	endif
endif
endif

elseif (player. getinworldspace anvilcastlecourtyardworld==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getinworldspace anvilworld==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getinworldspace bravilworld==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getinworldspace brumaworld==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather snow 1
elseif (weatherc==6)
	forceweather snow 1
endif
endif

elseif (player. getinworldspace cheydinhalworld==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getinworldspace chorrolworld==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getinworldspace icarboretumdistrict==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getinworldspace icarenadistrict==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getinworldspace icelvengardendistrict==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getinworldspace icimperialpalace==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getinworldspace icimperialprisondistrict==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getinworldspace icmarketdistrict==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getinworldspace ictalosplazadistrict==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getinworldspace ictempledistrict==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getinworldspace icthearcaneuniversity==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getinworldspace leyawiinworld==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getinworldspace skingradworld==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getincell SkingradCastleCourtyard==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

elseif (player. getincell chorrolarena==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	forceweather rain 1
elseif (weatherc==6)
	forceweather thunderstorm 1
endif
endif

end

Link to comment
Share on other sites

if~endif, elseif~endif? I think it's like:

if.........
  (blahblah)
elseif........
  (blahblah)
endif

 

If CS says something when you try to compile script, you have to see what's wrong, although it's mostly for syntax error(like other development tools).

Link to comment
Share on other sites

From the look of it to me, you have them mismatched.

 

 

You have

endif

 

then immediately after that

elseif

 

it should be like your internal blocks

if

elseif

endif

 

X--don't start another elseif here because the endif above ends the if.

Link to comment
Share on other sites

The rest of the scripts work but this one part which is at the begining doesn't work. But this part of the script is important. How Do I make it work?

 

if (player. getinworldspace tamriel ==1)
if (weatherc==1)
	forceweather clear 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==2)
	forceweather cloudy 1
elseif (weatherc==3)
	forceweather fog 1
elseif (weatherc==4)
	forceweather overcast 1
elseif (weatherc==5)
	if (player. getpos z >= 5000)
		setweather snow 1
	elseif 
		setweather rain 1
	endif
elseif (weatherc==6)
	if (player. getpos z >= 5000)
		setweather snow 1
	elseif 
		setweather thunderstorm 1
	endif
endif
endif

Link to comment
Share on other sites

Don't put a space after the period.

 

player.getinworldspace

player.getpos z

 

etc.

 

You keep saying "doesn't work." You need to be more specific. Exactly what happens? Exactly what doesn't work? What are the error messages? etc.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...