Code:
Problem description: What would be a sample equation for a training verb for example that multiplies a character's str mod by a certain number? I also would need to know how to code a verb that gains stats over time at the same time draining energy.
1
2
ID:157743
Jan 8 2010, 6:04 am
|
|
In response to Mechanios
|
|
Yeah I knew the + and - operators. Hmm so I would just have to code a multiplication problem to combine the stat mods with the verb. I just don't know how to code a verb gaining stats at whatever rate the mod is over time.
|
In response to Mechanios
|
|
< and > not [ and ].
|
In response to Howey
|
|
I apologize? Anyways I don't know how to code a verb that gians a certain stat over time. Could someone provide a sample equation?
|
Beerizant wrote:
What would be a sample equation for a training verb for example that multiplies a character's str mod by a certain number? mob/verb/training() I also would need to know how to code a verb that gains stats over time at the same time draining energy. mob/verb/gain_stats_over_time_while_draining_energy() |
In response to Loduwijk
|
|
So the sleep(200) means the recovery? Or the draining rate?
|
In response to Beerizant
|
|
Draining rate...
I hope you read the DM Guide/Reference. |
In response to Beerizant
|
|
http://www.byond.com/ members/?command=reference&path=proc%2Fsleep
sleep() makes the function wait for the specified number of 10ths of a second |
In response to Loduwijk
|
|
Yeah I read the ZBT and only skimmed the reference.
|
In response to Beerizant
|
|
Well now its saying that it's an invalid proc definition. Do I need to create a proc for it?
|
In response to Loduwijk
|
|
Instead of spoon-feeding yet another person who refuses to put much effort into learning how to program, how about you force him/her to by giving him/her concepts he/she need to read up on to accomplish the task he/she is going for. In this case, looping and operators are what he/she would want to educate him/herself on.
|
In response to Spunky_Girl
|
|
Spunky_Girl wrote:
Instead of spoon-feeding yet another person who refuses to put much effort into learning how to program, how about you force him/her to by giving him/her concepts he/she need to read up on to accomplish the task he/she is going for. In this case, looping and operators are what he/she would want to educate him/herself on. Eh em... I asked for a sample equation/code. I never asked for the whole damned code. A little advice: When someone needs help, don't be so gruff when giving it. |
In response to Beerizant
|
|
You said you could do math, and yet you still ask how to create a verb that does simple multiplication? As far as I'm aware, the Guide, Reference, and the Blue Book all teach you how to define verbs in various scenarios. Along with that, they teach you about loops and operators, which are all basic concepts of any programming language (only instead of verbs, it'd be methods in other languages like Java or C++) and can be used in different ways for any specific situation. You just need to use your imagination and logic skills more (assuming you have any at all).
|
In response to Beerizant
|
|
lodujwik already told you how.
mob/verb/gain_stats_over_time_while_draining_energy() |
In response to Beerizant
|
|
Maybe how-to should have some kind of regime. Like, an example of putting in effort. Stats are the basics and can be learned from the byond book, I beleive there is also a tutorial by Lummox Jr. that teaches you about making complicated stats specifically.
|
In response to Gamekrazzy
|
|
I understand the equation for it. I just needed to learn how to make it gain stats and drain energy which Lodujwik showed me, but it is coming up as an invalid proc definiton. I guess I need to figure out how to fix it.
|
In response to Beerizant
|
|
whats the problem?
|
In response to Gamekrazzy
|
|
<small>edit: deleted
|
In response to Beerizant
|
|
You copied it incorrectly.
|
1
2
The multiplication operator is * An example (this would output 4:)
[dm]usr << 2*2[/dm]
Also: for gain and loss there are the + and - operators.