In response to Kaioken
Hn, you did not typed in 'edit' in the topic :O :|

Anyways, Ichi, take out this line:flick(icon,src), why do you want to "flick" the same icon file that it's set as? It could overlayer (not really though) the other flick()... and make sure that the icon state is correctly spelt such as in the icon file.

And see the link in Kaio's post how to keep something in a certain icon state after (or rather, just before) the icon state

- GhostAnime
In response to Ichi
Ichi wrote:
Thanks for having patiance with me lol ok so what ive got is
> mob
> bush
> icon = 'bush.dmi'
> verb
> Cut()
> set src in oview(2)
> flick(icon,src)
> flick("cuting",src)
>

And when i walk up to it and click cut nothing happens (brb dinner)

Does the 'bush.dmi' icon have an icon state called "cuting" (I'm guessing "cutting" is what you were looking for)? Is it an animated state? If so (and it should be) how many frames is it?
In response to Ichi
Ichi wrote:
Thanks for having patiance with me lol ok so what ive got is
> mob
> bush
> icon = 'bush.dmi'
> verb
> Cut()
> set src in oview(2)
> flick(icon,src)
> flick("cuting",src)
>

And when i walk up to it and click cut nothing happens (brb dinner)

YOU ARE DEFINING A NEW TYPE OF /mob (/mob/bush). Unless this really is George Bush or something, CHANGE the "mob" in the first line to "obj"/"turf" immediately... you want an obj or turf, not a mob!
And again, read my previous post[s] in this topic.

@GhostAnime: "Hn, you did not typed in 'edit' in the topic :O :|"
Referring to me? No, I didn't edit a post. I did notice it weird. Apparently, I started writing my post before you guys, and it still preserved that date. Though I had something to do and went AFK, completing my post when I got back. Pretty much a forum bug...
In response to Flick
Ok yeah "cuting" is the icon state i want to flick (and its 3 frames long) then i wont it to be changed to the other icon state "cut" and stay as it also it being able to randomly drop money (ive already a made a money thin called rupees and it can only be droped in either 1 rupee (known as greenrupee) or in 5 rupees (know as bluerupee)

Also to Ghost ive tried taking the line out and still nothing happens, it dosent flick.
In response to Ichi
HELLO. I'M HERE. STOP IGNORING ME! :D READ MY PREVIOUS POSTS. They hold the meaning of existe- err, they hold the info you need.
In response to Ichi
YAY it finally works, now i only got 2 more problems lol!

1. after ive cut it once i can cut it again and it flicks again (dont whant this to happen)

2.i need it to drop rupees! (rupees details in other post, plz help me solve my final roblem!)
In response to Ichi
// You should probably use obj or turf here, but mob will work
obj
bush
icon = 'bush.dmi'
verb
Cut()
set src in oview(2)
//First, you want to flick the icon_state you are looking for on the bush.
//Afterwards, you need to set a small delay before changing to the new
//icon_state, or the flick gets overridden by the change of icon_state.
flick("cuting", src)
// Since your animation is 3 frames long, you need a three tick delay.
spawn(3)
src.icon_state = "cut" // Then, set your new icon state
In response to Ichi
Do yourself a favor and read my previous posts in this topic, it seems like you haven't, and they will help you, kthx. I also answered dropping items.

1. after ive cut it once i can cut it again and it flicks again (dont whant this to happen)

Most people would define a new var to the obj and then set it to 1 when the obj is Cut()ed, and disallow Cut()ing if the var is true. However IMO defining a new var is pretty useless, just check the icon_state, as in my prevoius post ([link]), after you Cut() the icon_state will be "tree_roots_state" (or whatever you used instead of it. So add this to the very beginning of the Cut() verb:
if(src.icon_state == "tree_roots_state")
usr << "This tree is already cut!"
return //stop the verb.


EDIT: Just read Flick's post. I don't remember if flick() returns immediately or only after the animation is done. If the former, then yes, you should delay the icon_state change via sleep() or spawn() by the number of frames the icon has multiplied by the delay between each. Example: My animation has 5 frames, and the delay is 1. 5 * 1 = 5, so use 5 in sleep() or spawn(). Another example: My animation has 3 frames, and the delay is 5. sleep() or spawn() for 5 * 3 = 15.
In response to Kaioken
I've tried putting that in use and it says "If statement has no effect"
In response to Kaioken
...Which means you did it incorrectly. Just copy the code from my previous post and change only the "roots_state" to the right one.

Also, if you expect help, when posting an error message, post the relevant code for it alongside it. Otherwise, it's gonna be pretty difficult to help you. =P
In response to Kaioken
Right so if i put it in like this:
obj
bush
icon = 'bush.dmi'
verb
Cut()
set src in oview(1)
flick(icon,src)
flick("cuting",src)
usr << 'cutgrass.wav'
src.icon_state = "cut"
if(src.icon_state == "cut")
usr << "This tree is already cut!"
return //stop the verb.

I get this error:
grass.dm:53:error:usr:duplicate definition
grass.dm:53:error:"This tree is already cut!":duplicate definition
grass.dm:53:error:<< :instruction not allowed here
grass.dm:54:error:return :instruction not allowed here
grass.dm:53:error::invalid expression

Or if i put it like this:
obj
bush
icon = 'bush.dmi'
verb
Cut()
set src in oview(1)
flick(icon,src)
flick("cuting",src)
usr << 'cutgrass.wav'
src.icon_state = "cut"
if(src.icon_state == "cut")
usr << "This tree is already cut!"
return //stop the verb.

I get the error of:
grass.dm:52:if :warning: if statement has no effect
In response to Ichi
You need to indent every statement under the if()
In response to Xx Dark Wizard xX
could you write it out? not to sure what you mean.
In response to Ichi
Dude, thats REALLY basic stuff! You need to read some tutorials ASAP, you don't know this simple stuff?
Identing means "tabbing" the code so the compiler knows it belongs to the if.
So this is incorrect, and indeed this way the if statement will have no effect:
    if(src.icon_state == "cut")
usr << "This tree is already cut!"
return //stop the verb.

And this is the correct way:
    if(src.icon_state == "cut")
usr << "This tree is already cut!"
return //stop the verb.
In response to Kaioken
well ive tried that, that is if you mean this?:
    bush
icon = 'bush.dmi'
verb
Cut()
set src in oview(1)
flick(icon,src)
flick("cuting",src)
usr << 'cutgrass.wav'
src.icon_state = "cut"
if(src.icon_state == "cut")
return //stop the verb.

???
If so then it says:
grass.dm:53: Inconsistent indentation.
In response to Ichi
Ichi wrote:
well ive tried that, that is if you mean this?:
>     bush
> icon = 'bush.dmi'
> verb
> Cut()
> set src in oview(1)
> flick(icon,src)
> flick("cuting",src)
> usr << 'cutgrass.wav'
> src.icon_state = "cut"
> if(src.icon_state == "cut")
> return //stop the verb.
>

???
If so then it says:
> grass.dm:53: Inconsistent indentation.
>



You don't even know about proper tabbing/identation, please do ME a favor and READ TUTORIALS. I'm off now, I'll be back later to help, though if you're still at this same problem, I will simply ignore you, because you ignore me and don't read tutorials. Good luck.

For the 1000th time, you need to press the Tab key on your keyboard in DreamMaker to add identation, so the "usr<<" and "return" commands appear more to the right than the rest of the code, and so belong to the if.
So the correct code is...
        verb
Cut()
set src in oview(1)
flick("cuting",src)
usr << 'cutgrass.wav'
src.icon_state = "cut"
if(src.icon_state == "cut")
usr << "This tree is already cut!"
return //stop the verb.
In response to Ichi
Ok!! almost there, now just one last thing lol, dropping the rupees(money) what i need it to do is drop either a greenrupee or a blue one and this is what i have done:
obj
bush
icon = 'bush.dmi'
verb
Cut()
set src in oview(1)
if(src.icon_state == "cut")
return //stop the verb.
flick(icon,src)
flick("cuting",src)
usr << 'cutgrass.wav'
src.icon_state = "cut"
rand(1,10)
if(1)
var/obj/greenrupee/r = new(src.loc)
r.amount = 1 //amount var. like with money bags, how much wood there is
if(10)
var/obj/bluerupee/r = new(src.loc)
r.amount = 5 //amount var. like with money bags, how much wood there is

and these are the errors i get:
grass.dm:54:rand :warning: The rand statement is being faded out.  Use pick() instead if possible.
grass.dm:55:error::invalid expression
In response to Ichi
Aha! Got it! nvm about the last thing THANK YOU ALOT evybody who helped me, it is much apprieciated!
In response to Ichi
I repeat myself. You need to stop now and look back. Read some basic tutorials, stop ignoring it when I say it. You barely know the language, further implied by your last post. I saw you got past it somehow, but I will explain it anyway;

         rand(1,10)
if(1)
var/obj/greenrupee/r = new(src.loc)
r.amount = 1
if(10)
var/obj/bluerupee/r = new(src.loc)
r.amount = 5

That's REALLY flawed code. It's obvious you don't know what you're doing, you're just randomly trying stuff without reading around. Having rand(1,10) in it's own line like that is useless. It will return a random value, but nothing will be done with it. You need to store it or check it somehow. You can't ident if()s to it. Checking if(1) and if(10) will ALWAYS pass the test and execute the idented code, because it has nothing to do with the rand() above it, and 1 and 10 are TRUE values (non-zero). You need to reference the value rand() returns, just using it like that is very useless. Also, again, you are using things with basically having no idea about what they do. Read on rand() in the reference, will return a random integer BETWEEN the first argument/parameter and the second parameter. So it can be 1,2,3,4,5,6,7,8,9 or 10. If you want 2 different results, you use rand(1,2). Working example:
var/number = rand(1,2)
if(number == 1)
var/obj/whatever/O = new(src.loc)
O.amount = 5
if(number == 2)
var/obj/whatever2/O = new(src.loc)
O.amount = 10

That stores the returned value of rand(), and then checks it. However, despite it working, it is still incorrect. There is a better way to do it, similar to what you attempted (but of course the difference is that this way WORKS). Read up on the reference on switch(). And do it. It's obvious you don't read when people direct you to doing it, but why? You read our posts, so read what we redirect you to as well. We could just copy paste it here and have you read it. switch() checks a single value and allows checking it for various results; pretty much shortening multiple if()s.
switch(rand(1,2))
if(1) //short for 'if(rand(1,2))==1'. though of course it will be about the same value all the time
var/obj/whatever/O = new(src.loc)
O.amount = 5
if(2) //short for 'if(rand(1,2))==2'. though of course it will be about the same value all the time
var/obj/whatever2/O = new(src.loc)
O.amount = 10
In response to Kaioken
Kaioken wrote:
Read on rand() in the reference, will return a random integer BETWEEN the first argument/parameter and the second parameter. So it can be 1,2,3,4,5,6,7,8,9 or 10. If you want 2 different results, you use rand(1,2).

Unless you only want a 10% chance of either of those two results with an 80% chance of failure. In which case changing 'rand(1,10)' to 'switch(rand(1,10))' would have been the only alteration necessary.

Page: 1 2 3