![]() |
Help
hey i dont understand Variables (cant spell it) and what the do. i went on your site projectshifter and i got to the variables bit and i just didnt understand what they do?can some one help me learn them?
|
Ah, they are VERY useful. They keep track of numbers. For example:
NPC Code: that makes this.hit go up ONE time everytime it was hit. And it will display it via #c as how many hits have happened. This.vars are ONLY for NUMBERS, no data can be stored in them. But I've done things like this: NPC Code: Something like that, i'm not exactly sure b/c I'm at school :P and i don't have much time. BUT I had a central NPC set npcs[1].save[1 and 2] to it's x and y. So this.dist was the distance it was from the central point. It was useful because I was making a clock that rotated around the middle, so I didn't have to code everything to be so far from the central point, I could move it out to ANY distance I wanted and it would still make a circle around that middle point. the radius changed, but the middle point didn't :D Try some stuff... I'll get you some examples if I get home in time. ---Shifter |
i get..
hey i get the top one but not the bottom one :/ i think it has something to do with the save and stuff in it
the top 1 is easy to understand and i think i can get the hang of it to Quote:
--snakeandy |
do not format like shifter because his formatting is teh suck :| (no offence)
|
w00t WooT! USe my scripting style, it's going Revolutionary! people use it :P Yes, I like my scripting, just b/c you don't doesn't mean you are allowed to become jealous ;) But obviously you're not sure how to use functions :P If you put: something(); it means that it will jump to the part of the scripted marked:
function something() and perform all actions under it. I always use return; at the end if it isn't looping for teh hell of it. What you did would have it set it to what you said, then it would set to mine, so it then becomes inefficient b/c you are setting it twice and one will be erased too fast to read it? ---Shifter |
i think functions should have custom variables that can only be used inside the functions, e.g.
PHP Code:
|
Quote:
|
*realises this*
but it SHOULD be added. |
Quote:
|
Exactly!
|
WTF is the point?? If you can ONLY set them in functions??? Just have the variables ONLY be changed by them then =/
---Shifter |
You'd need an actual return command then, like
return account,message; |
Um, this.vars work regardless of where. then ONLY have functions edit them x.X!
---Shifter |
Shifter, what's your point? Of course there is a way to work around not being able to pass strings/variables to functions, but the point is that being able to do so would greatly increase the functionality of functions...
|
Function arguments, it was suggested by me and a few other people long long time ago, yet never added, Some problem that graal isn't too object-orientated. *shrugs*
|
Okay, I must admit I am QUITE confused. Are you saying functions aren't able to use vars?!?! What is the point of vars that ONLY can be read and edited by functions? It shouldn't matter because if you have a this.var and the only thing that modifies it is the functions, it works out. I guess I must be missing what you guys are saying...
---Shifter |
Quote:
function(showing,stuff); if i called that and the function name was function($1,$2){ echo "$1"; echo "$2"; } it would display this showing stuff |
Variables can be used in functions. If statements are run before functions.
|
meh but im so lazy... and i dont see why it cant be done this way.
i can see(by the brackets at the end of the function) that this way was in use once or was planned to be in use. |
Quote:
|
Quote:
|
Quote:
|
stop killing my fun dammit!
|
*Jealous of Robin's signature image* :(
|
Bwahaha upgrade account for me and i will make one like it for you
|
blah blah blah why are you trying to script? your just copying some one else who learned how to script who copied some one else who learned how to script who copied some one else who learned how to script who copied some one else who learned how to script who copied some one else who learned how to script who copied some one else who learned how to script who copied some one else who learned how to script who copied some one else who learned how to script who copied some one else who learned how to script who copied some one else who learned how to script who copied some one else who learned how to script who copied some one else who learned how to script who copied some one else who learned how to script who copied some one else who learned how to script who copied some one else who learned how to script who copied some one else who learned how to script who copied some one else who learned how to script who copied some one else who learned how to script and it keeps going on and on so if you dont wanna be flamed like this pointless post you should just give up now because being original is the shnap
|
well
i really need help on how to make money on graal with scripts like bread making from 2001 and so on
thats all i really wanna learn i think i got the hang of vars this.x=+4; blah de blah XD -Snakeandy |
Re: well
Quote:
|
Magnoria... sounds a bit like maloria
just the name :P |
Quote:
is that why I get flamed? the name?? maybe I'll change it... but I thought of magnoria a long time ago and posted some stuff on it then maloria came up and I was like "wut the heck..?" |
yeah buddy right
|
| All times are GMT +2. The time now is 07:53 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.