Page 1 of 1

help

Posted: September 11th, 2009, 5:27 am
by shadow09231990
im having trouble with getting a few things to work in my map. the first thing is im trying to make some basic quests: the first quest is to collect 5 keys of "the gods". the second is im trying to make it so you have a princess.
another problem is im trying to make it so you have to collect the 5 keys in order to open one door
(to gain access to the princess), but i dont know how to. the following is my .cfg

Code: Select all

//aliases

"on_start" = [
money = 0
wolf = 0
keys = 0
totalkeys = 0
totalprincess = 0
pickedkey1 = 0 
keyquests = 0 
doorquest = 0 
finishedquests = 0 
totalquests = 0 
money = 0 
finisheddoor1 = 0
]

mmodel "rpg/characters/wolf"

mmodel "rpg/objects/coin/silver"

mmodel "rpg/characters/npcman"

music burn.ogg

loop i 5 [
		(format "gotkey%1" (+ $i 1)) = 0
	]

mapsound "freesound/FamilyGuy_StewieInsult" 255 32767 // 5
mapsound "freesound/FamilyGuy_StewieSickTwistedFruit" 255 32767 // 6


//aliases


"level_trigger_1" = [ money = ( + $money 5 ) 
echo "You got 5 money."
]

newgui main [
guilist [
guilist [
guibutton "Quest information" "showgui quests"
guibutton "Inventory" "showgui Inventory"
]
]
guibar
@main
]

newgui Inventory [
guibutton "Back" "cleargui 1"
guibar
guitext ( format "You have %1 moneys in your wallet." $money )
guitext ( format "You have %1 wolf." $wolf)
guitext (format "You currently carry %1 keys" $totalkeys)
guibar
newgui quests [
		guibutton "Back" "cleargui 1"
		guibar
		guitext (format "You've obtained %1 out of 2 quests" $totalquests)
		guitext (format "You've finished %1 out of 2 quests" $finishedquests)
		guibar
		guitext (format "You've obtained %1 out of 5 keys" $totalkeys)
		guitext (format "You've obtained %1 out of 1 princess" $totalprincess)
	]
]
	newgui quest1 [
		if ( (> $keys 0) (= $pickedkeys1 2))
		guibar 
		if $pickedkeys1 [
			guitext "where could those keys be"
			guitext "i still need to collect %1 more keys to save the princess"
		]
	] "the gods keys"

	newgui quest2 [
		if (|| (> $princess 1) (= $savetheprincess1 2)) [
			guitext "now i must save the princess."
		] [
			guitext "i have obtained all the keys."
		]
		guibar 
		if $pickedkeys1 [
			guitext "she must be somewhere in here."
		] [
			guitext "now i must venture to princess temple."
		]
	] "a lost princess"

	"pickup" = [
	if (= (getalias (format "gotkey%1" $arg1)) 0) [
		(format "gotkey%1" $arg1) = 1
		echo "0You've picked up a key"
		key = (+ $key 1)
		totalkeys = (+ $totalkeys 1)
	] [
	]
]

"gotkey1" = [0]
"gotkey3" = [0]
"gotkey2" = [0]
"gotkey5" = [0]
"gotkey4" = [0]


"level_trigger_11" = [showgui rob-zombi]
newgui rob-zombi [
					guitext "Hello there, can i ask you a favor?" chat
				guibar
				guilist [
				guibutton "yes"
				guibutton "no" "cleargui 1"
	][

					guitext "you must travel all over this vast land to get the keys of the gods." chat
					guitext "it is all in an effort to save the princess." chat
					guitext "please hurry and find the keys brave worrier" chat
					guibutton "i will go as fast as i can." chat
					]
			]



level_trigger_3 = [showgui princess-peach]
newgui princess-peach [
guitext "my hero!" chat
guitext "your not mario!" chat
guitext "wrong princess idiot!" chat
]

level_trigger_4 = [showgui zelda]
newgui zelda [
guitext "my hero!" chat
guitext "you win!" chat
]

"level_trigger_10" = [if (= $totalkeys 5)
"level_trigger_9" = [pickup 9]
"level_trigger_8" = [pickup 8]
"level_trigger_7" = [pickup 7]
"level_trigger_6" = [pickup 6]
"level_trigger_5" = [pickup 5]
now i know that those arent the only problems i have but they are the ones i can think of off hand. i will appreciate any help i can get from anyone. please help me.

Re: help

Posted: September 25th, 2009, 8:00 am
by Mike
Have you looked at the FAQ yet? My village modification example even uses keys, and five of them. Take care.
-mike

Re: help

Posted: December 11th, 2009, 1:31 pm
by bryanfblareunion
if [ ( = $numkeys 5) trigger 10 1 ] (((((if 10 is ur door)))))

hope this helps :geek: