running out of ink..

For help with creating games using Quest

Moderators: Pertex, Cryophile, Alex, sgreig

running out of ink..

Postby bil » Thu Feb 02, 2012 9:27 pm

hello,
im new to the program, i just downloaded it yesterday.
so far so good,for the most part. i have a basic map laid out and some items/objects to interact with, but!..

today i have spent about two hours trying to get an object (marker) to run out of ink.
i set an attribute for the marker ink to 15 integer. in setup for the object(marker) i set up a print expression : "marker, ink " + marker.ink + " ink."
also in "use object" print: expression : "marker.ink = marker.ink - 1"
now if i use the marker, it says -1 but when i look at the object it still says 15 for the ink integer.

so basically.. how can i set a value and every time i use the object the value will decrease?

sorry if this is a little ruff, im not used to any of these terms or lingo. :?
oh, i also watched the video for the "eggs and flower" and read the wiki quite a few times..but i must be missing something.
thanks
bill.
bil
 
Posts: 6
Joined: Thu Feb 02, 2012 9:15 pm
Location: philadelphia, pa

Re: running out of ink..

Postby bil » Thu Feb 02, 2012 10:54 pm

also.. im not completely helpless. =)

i have made locked doors(turnstiles) unlock-able using tokens.
i have made a small rock object that if you throw it , it hits someone and a vigilante attacks you and ends the game.
with that same rock if you throw it at a group of pigeons they in-turn attack you and rip your face off , ending the game.
or you can use the rock to carve your name into a wall. all using multiple scripts that show text and pictures. so there is hope i guess.

my main obstacle now is quantities/attribute values of an object as stated in the previous post.

im having fun with this.
thanks.
bil
 
Posts: 6
Joined: Thu Feb 02, 2012 9:15 pm
Location: philadelphia, pa

Re: running out of ink..

Postby Pertex » Fri Feb 03, 2012 8:40 am

in "use object" you print "marker.ink = marker.ink - 1" ? If you use "set variable or attribute" it should work
User avatar
Pertex
 
Posts: 1105
Joined: Fri Jul 09, 2010 9:52 am
Location: germany

Re: running out of ink..

Postby bil » Fri Feb 03, 2012 1:32 pm

thanks pertex,

i swore thats what i did.. im going to try again later today to see what i did wrong.

once i get it right it will help with a number of other items as well.
bil
 
Posts: 6
Joined: Thu Feb 02, 2012 9:15 pm
Location: philadelphia, pa

Re: running out of ink..

Postby bil » Fri Feb 03, 2012 1:43 pm

pertex

If you use "set variable or attribute" it should work

sorry , could you explain this? ^

i did this:
i did set an attribute in the marker/object the attribute is: "ink" with a value of 15.

i set the "use object" to : "marker.ink = marker.ink - 1" in the print/expression.

the ink value never decreases. =(

thanks for the help..i really cant figure this one out.
bil
 
Posts: 6
Joined: Thu Feb 02, 2012 9:15 pm
Location: philadelphia, pa

Re: running out of ink..

Postby Pertex » Fri Feb 03, 2012 2:19 pm

If you use the expression "marker.ink = marker.ink - 1" with the print-command, Q5 wil print the result of the expression. marker.ink is not equal marker.ink - 1 so it will print FALSE to the screen. The attribute is not changed in print-command. If you want to change an attribute, you can do this with the command "Set a variable or attribute" which you find under the section "Variables"
Attachments
marker.jpg
marker.jpg (104.15 KiB) Viewed 415 times
User avatar
Pertex
 
Posts: 1105
Joined: Fri Jul 09, 2010 9:52 am
Location: germany

Re: running out of ink..

Postby bil » Fri Feb 03, 2012 2:48 pm

i actually tried that too..

under "use/give for the marker object"
i add the new script.. variables- set a variable or attribute..
the "box " reads: set variable ___ = expression ___________________
blank^ blank/with drop down box^

i tried "-1" in the first blank and with the drop down box selected "variable" and chose "ink" for the second box.


doesnt work.. but im sure im filling it out wrong.


edit!!.. oh thanks for the .jpg!!!! im going to try that now!!!
thanks for the patience pertex!!
bil
 
Posts: 6
Joined: Thu Feb 02, 2012 9:15 pm
Location: philadelphia, pa

Re: running out of ink..

Postby bil » Fri Feb 03, 2012 2:52 pm

THANKS!
ok great ..it worked..

now i just gotta stop it from going into negative integers! =)


edit.. i actually figured out how to remove object when it hits "integer 0" exactly what i needed!


thank you so much pertex.
huge help with the decreasing integer bit. and that in a way helped me figure out how to stop it at zero and have the object remove itself with the "if" command.
bil
 
Posts: 6
Joined: Thu Feb 02, 2012 9:15 pm
Location: philadelphia, pa


Return to Quest Forum

Who is online

Users browsing this forum: Yahoo [Bot] and 0 guests