ID:165582
![]() Nov 28 2006, 12:50 pm
|
|
Problem description: I'm trying to make it so say theres a bush, when you walk up to it you can click a button saying "Cut" or something liek that, and when you click it is it possable to flick the icon of the bush to say leavs flying down to the ground then its completely changed to a pic with the roots of the bush, also it being able to drop random items. |
![]() Nov 29 2006, 12:10 am
|
|
Please can anybody help me?!?! i need this!
|
i have and ive tried puting it into use but it only tells you how to flick the icon of the usr not the bush
|
... um, try defining where the bush is? Afterall, how can you cut the bush if you can not define it? Than flick using the bush as the source (object)... usr is just an example there...
- GhostAnime |
I've tried this:
obj And then i get an error saying grass.dm:7:error:obj:undefined var Also i dont know how to make it so after its been flicked it changes icon permenatly. If somecould write it out how to do it? id be very thankfull. |
Seriously, go read the DM Guide, go and do NOT skim through... I never said anything about 'obj', just 'object'... look it up in the dictionary if you don't get it yet.
Hint: src = source; usr = last player that did something (I think that's what it is) And why are you flicking the icon file which it already is? At the sametime when the tree is cut? :/ - GhostAnime |
obj - Miran94 |
Im looking through the DM guide and i can only find were its told me how to jst flick it, and all its says is
flick('blink.dmi',usr) //show another icon And ive tried using that and it dosent work. |
Why don't you actually read the whole thing instead of looking at the EXAMPLES (definition: trying to convey the message to you by using of it).
In place of 'usr', make it refer to the bush... if you can't figure out how to do that, read the DM Guide -_- The important line about that entry in reference: Format: flick(Icon,Object) Args: Icon: An icon file or state name. Object: The target object. To become a great programmer, you must remember about the little things; for even the slightest of problems can make the gravest of situations. Your answer is so simple that I am assuming you did not read into the DM Guide and instead just look at "examples" and trying to format them into your use; even though it may eventually cause your game to collaspe in the end. - GhostAnime |
GhostAnime wrote:
Why don't you actually read the whole thing instead of looking at the EXAMPLES (definition: trying to convey the message to you by using of it). Seconded, damn listen to the guy. In addition, from what I gathered from your first post, you DO NOT want 2 flick()'s. You want something like this instead: flick("leaves_falling_state",Target) Of course, for this code to work, replace 'Target' with the right var. I'm not telling you that, though I will point you to aread on the subject: -DM reference (press F1 in DreamMaker). Look up 'usr (proc)' and read that. Afterwards, look up 'src (proc)'. ---EDIT--- I took the liberty to add some sample 'item system' verbs to the code example. =) Also, changed added "apple" instead of using plain "fruit". :P |
.< I'm trying my best to understand it, and im not just looking at the examples, i am reading it but as i said i find it difficult to understand ive tried replacing "obj" with object then i get the error of undifined var i've tried replacing with "Target" samething anything i put there it says that its an undifined var |
... Okay, I'll be nice and tell you the answer.. if you do not understand why, you'll probably forgo programming >_> Which may not be a bad thing :[ : You want src
READ AND LEARN AS TO WHY ------------------------ The variable 'src' is a variable that REFERS to the SOURCE (s__rc_) of the verb/procedure. Usr, as stated in the link, is a mob variable (var/mob/usr) containing the mob of the player who executed the current verb, or whose action ultimately called the current proc. Reason why usr didn't worked is because that was refering to the last PLAYER who called something, which was YOU. Src in this case is the bush as the bush has the verb, thus the Bush is the SRC in that verb (heh, repitition should help you remember). And you can have other targets there as well if you make variables referring to an object.
mob/M = locate(/mob) in get_step(src,dir)
if(!M)return
flick("apple",M)
- GhostAnime |
Ok i give up! i guess ill take your advice and quit! i still dont understand damit, ive tried using "src" instead and its worked (as in stopped it from saying invalid proc) and when i walk up to the bush click cut nothing happens, ive tried everything, sorry for being such a noob but ive just started and ive tried all the examples youve given me ive been trying it all day no luck.
|
That's why I kept stating to READ the DM Guide; if you can not take your time to learn how to program properly (although the Guide IS outdated), than you'll keep running in blindly. As a side note, I never adviced you to quit, prove it to me if I did say so :P
If you still do wish to continue programming, my advice is: learn first than attempt. That's why sometimes we also state to start small scale projects and work up. To learn how to program in DM: http://www.byond.com/docs/guide/ http://zilal.byond.com/tutorials/zbt.html http://bwicki.byond.com/ByondBwicki.dmb?MiniTutorials http://bwicki.byond.com/ ByondBwicki.dmb?FrequentlyAskedQuestions - GhostAnime |
Well i know basic stuff like how to teleport how to play music make maps use "Say" verb and basic things like that, but when it comes to this, i just cannot do it! im read the DM Guide as we speak and im trying to read it all and i still carnt get this damn thing to work. (is there an updated DM Guide?)
|
Unfortunately no. Now that I just ate lunch, I am less grumpy. If you could post an updated copy of your snippet in which you're having trouble with, we can help try to find the cause.
- GhostAnime |
Dont forget checking out my above post on further help. :P
[link] |