Im gonna literally beg now because this is driving me insane! PLEASE! someone explain how to make a verb throw a laso from the usr to the mob and lock the mobs movement i want the laso to have rope connecting the usr to the Mob.
and please... NO beam demos.... no offense Radditz but its too difficult!
Ice: PLEASE!!!!
ID:270827
![]() Sep 21 2006, 1:38 pm
|
|
Dude, if you know the right way to implement a projectile then deliberately show somebody the wrong way, you need to stop offering code help. Actually if you show them the wrong way at all, it's time to stop. Bad enough to not know what you're doing, but worse to know and still do it wrong. If you're gonna use code you know is lousy, do it on your own, but don't offer it on the forums to people who need help.
Lummox JR |
mob/var/canmove="Yes" |
Falacy wrote:
mob/var/canmove=1 whats with the yes and no? |
Lightning Inc. wrote:
whats with the yes and no? lol 1s and 0s are lame... plus usualy when i use canmove i have mulitple reasons, KO, busy, just plain no... so just using 1 and 0 for it doesnt satisfy my needs! |
I think something like this would be better:
#define LASSO 1 I haven't actually tested it, but what it should do is allow you to pick up a lasso and equip it. Once equipped, you may click anywhere on the map to THROW the lasso there. Once thrown, it will use <code>missile()</code (though I think it returns immidiatly, allowing no chance of escape; I think hub://Spuzzum.s_missile would do better under the circumstance) to deliver the lasso there. If a person is standing on the tile the person will be bound by the lasso (and cannot move by themself). You can free someone by clicking them (assuming you're not bound yourself). |
Lightning Inc. wrote:
but you could just use !,null etc lol and then you have to remember what each value represents... plus that still only leaves what, 3 choices? 1 0 null, still not enough, cause then what are you gona use when they can move? |
if(canmove)//the var is 1 |
Falacy wrote:
Lightning Inc. wrote: Consider using bit flags if you have multiple booleans like KO and busy. #define KO 1 Keep in mind that the numbers are binary. 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, ... |
Falacy wrote:
lol and how is that easier then just putting busy? You're only using one variable instead of three. Alternate version: mob You should know that programming shouldn't be about doing things as easy as possible; it's about doing it as efficent as possible. My example allows you to store those three variables into one single variable, which I think is what you were on about. Even if it wasn't, it's a good lesson for you to use bit flags for booleans. |
Falacy wrote:
lol and how is that easier then just putting busy? Easier? Maybe not. Faster and more robust? HECK YES. But hey, if you want laggy games and broken code, go right ahead! |
Programming is about producing a wanted result for some reason. Are their any understandable guides on bitflags anyway? I never really understood them.
|
Why would you have multiple reasons why a user can move? Scratch that, why would you even record them? That's ultimately useless.
|
Thank you for making me feel guilty :( Fine, fine, next time I'll be sure to give "good" help.. though as I like to piss people off, I'll probably make it a bit cryptic.
- GhostAnime - Feels very.. :( -ish ... God I wish work was finished now so I can go get a drink -_- >.> Atleast I left comments as so Ice can learn new tricks <.< I am not TOTALLY evil, about 89% I am .. |
using less data: since i doubt byond 1s and 0s are actualy boolean, and instead are integers, they would take up more memory then a character, ie B, but a whole string ie Busy would probably be more yes
efficieny: a program checking for a 1 vs a busy is not going to run 10 times slower, yeesh get a grip lol using more variables: im not using more then 1 variable? im just setting canmove="Busy" canmove="KOed" etc... |
WARNING: Untested, probably useless.. but hey, you MIGHT learn something and make your own
NOTICE: READ THE COMMENTS!!!
This is meant to teach you ONE possible way of doing what you said (from what I gathered).
Somebody double check this for me and prove me wrong, once again >_<
Live, learn, and die in a horrible fasioned way because nobody cares about you.. maybe not even in the way you die
- GhostAnime - Being emo is hardcore... but it's not like you guys care about me anyways...*slits wrist and sings Barney's theme song*