running out of ink..

bil
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
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.

Pertex
in "use object" you print "marker.ink = marker.ink - 1" ? If you use "set variable or attribute" it should work

bil
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
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.

Pertex
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"
marker.jpg

bil
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
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.

This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums