Page 1 of 1

How to make a quest?

Posted: June 7th, 2010, 9:45 pm
by xnevilnx07

Code: Select all

rubbish = 0
movespeed 100
newgui main [
	guilist [
		guilist [
			guibutton "Quest information" "showgui quests"
			guibutton "Inventory" "showgui inventory"
		]
		guibar
		guilist [
			guibutton "About" "showgui About"

		]
	]
	guibar
	@main
]

newgui inventory [
	guibutton "Back" "cleargui 1"
	guibar
	guitext (format "You currently carry %1 rubbish" (+ $rubbish))
	
]
newgui James [
 guitext "Oh My Goodness!" chat
 guitext "Who are you and where are you from?" chat
 guitext "What is that? It crashed and messed up my garden." chat
 guitext "You must be responsible on it." chat
 guibar
 guibutton "What should for you?" "showgui npc1-1"chat

] "Angry gardener"


"level_trigger_1" = [ showgui James ]

"level_trigger_%1" = [ rubbish = ( + $rubbish 1) ]

newgui quest [ 
	if (> $rubbish 10) [
	guitext "No, my garden is still dirty." chat
	guitext "Hurry up, or i'll call the police and report you." chat
]
	if (= $rubbish 10) [
	guitext "Well, now my garden look better ." chat
	guitext "But I think there's a strange metal part near the fat tree in my garden." chat
	guitext "Go and picked it up and leave my garden away with your airship." chat
	guibar
	guibutton "Bye."
	]
]

newgui npc1-1 [
	guitext "Seems that you have messed up my garden." chat
	guitext "So help me to clean my garden." chat
	guibar
	guibutton "I have clean it." "showgui quest" chat

	] "James"

on this is my code....
Anyone can help me & teach me how can i set up a quest inside game...
the quest code:

Code: Select all

newgui quest [ 
	if (> $rubbish 10) [
	guitext "No, my garden is still dirty." chat
	guitext "Hurry up, or i'll call the police and report you." chat
]
	if (= $rubbish 10) [
	guitext "Well, now my garden look better ." chat
	guitext "But I think there's a strange metal part near the fat tree in my garden." chat
	guitext "Go and picked it up and leave my garden away with your airship." chat
	guibar
	guibutton "Bye."
	]
]
what wrong in the code???

Re: Hw to make a quest?

Posted: June 8th, 2010, 9:17 am
by arcones

Code: Select all

"level_trigger_%1" = [ rubbish = ( + $rubbish 1) ] //Here's what is wrong. You can't place a % before the number. It won't recognize it

That's your problem I believe.

Arcones :geek:

Re: How to make a quest?

Posted: June 8th, 2010, 7:37 pm
by xnevilnx07
So i need to change it like this >>>"level_trigger_1%" = [ rubbish = ( + $rubbish 1) ] is it correct now???

Re: How to make a quest?

Posted: June 8th, 2010, 7:45 pm
by Venima
no...

Code: Select all

level_trigger_1 = [rubbish = (+ $rubbish 1)]
You can check this page in the future to make sure your code is correct: List of scripting commands

Alternatively if you want constant feedback, you can try out my CFG editor (links in my signature). It doesn't have all the scripting commands, it knows a considerable number of them.

Re: How to make a quest?

Posted: June 8th, 2010, 8:05 pm
by xnevilnx07
I changed the code now.thxz
Did the quest code correct???