Tag Setting Variables

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

Post Reply
User avatar
Master K
King Slime
Posts: 1899
Joined: Sat Jun 11, 2011 9:40 pm
Location: A windswept rock in the Atlantic Ocean

Tag Setting Variables

Post 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?
User avatar
Gizmog
Metal King Slime
Posts: 2614
Joined: Tue Feb 19, 2008 5:41 am

Post 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
Last edited by Gizmog on Thu Sep 15, 2011 7:56 pm, edited 1 time in total.
User avatar
Mogri
Super Slime
Posts: 4598
Joined: Mon Oct 15, 2007 6:38 pm
Location: Austin, TX
Contact:

Post 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.
Post Reply