Page 1 of 1

Tag Setting Variables

Posted: Thu Sep 15, 2011 7:52 pm
by Master K
I'm working on a script that randomly sets a choice of five tags on or off. But, it will not compile. It says an extra begin in it. Heres the script.

Code: Select all

plotscript, merchant tags, begin
	variable(merchant)
	set variable(merchant,random(1,15)
	
	if (merchant == 1) then (set tag(26,ON)
	if (merchant == 2) then (set tag(27,ON)
	if (merchant == 3) then (set tag(28,ON)
	if (merchant == 4) then (set tag(29,ON)
	if (merchant == 5) then (set tag(30,ON)
	if (merchant == 6) then (set tag(26,OFF)
	if (merchant == 7) then (set tag(27,OFF)
	if (merchant == 8) then (set tag(28,OFF)
	if (merchant == 9) then (set tag(29,OFF)
	if (merchant == 10) then (set tag(30,OFF)
	
	end	
Can you stop what is wrong?

Posted: Thu Sep 15, 2011 7:55 pm
by Gizmog
setvariable (merchant,random(1,15)

should be

setvariable (merchant,random(1,15))

and actually, it looks like every settag is msising a ) too

Posted: Thu Sep 15, 2011 9:49 pm
by Mogri
Remember that ( and ) are exactly the same as begin and end, respectively. If you're not using an editor that does parenthesis matching, you should switch now. Notepad++ is an excellent editor.