Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   alright how does it work (https://forums.graalonline.com/forums/showthread.php?t=69125)

_Z3phyr_ 10-03-2006 12:51 AM

alright how does it work
 
I see people say prefix.("varname" @ temp.towahth @ "wejthakwlh") = 1;

If this doesn't have anything to do with what I'm about to ask then just pretend I didn't metion it and answer the question anyway:


When you want to declare a value/assign/whatever... nevermind how do I do this:

this.thisismyvarONE = the variable I that I want to edit.

this.varname = "ONE";
this.("thisismyvar" @ this.varname) = 1;


^ please explain how to do because I'm doing it wrong apparently.

Yen 10-03-2006 02:04 AM

What you're doing should work.

fowlplay4 10-04-2006 05:38 AM

You could also do this..
PHP Code:

function onCreated() {
 
this.varname "ONE";
 
makevar("this." this.varname) = 1;
 
chat "this.ONE =" SPC this.ONE;


Its just a matter of personal preference I guess..

xAndrewx 10-04-2006 08:20 AM

Quote:

Originally Posted by fowlplay4 (Post 1225798)
You could also do this..
PHP Code:

function onCreated() {
 
this.varname "ONE";
 
makevar("this." this.varname) = 1;
 
chat "this.ONE =" SPC this.ONE;


Its just a matter of personal preference I guess..

Indeed it is, I'm starting to use makevar, however I prefer to use this.("blah" @ LOLDIE); =(

Skyld 10-04-2006 09:11 AM

Quote:

Originally Posted by xAndrewx (Post 1225827)
Indeed it is, I'm starting to use makevar, however I prefer to use this.("blah" @ LOLDIE); =(

makevar() is untidy and I strongly dislike it when people use it. this.(@ foo) = bar; is the best way in my opinion.

_Z3phyr_ 10-04-2006 09:37 AM

Quote:

Originally Posted by Skyld (Post 1225834)
this.(@ foo) = bar;


So if I'm going to start the variable's name with the value of another variable, I need to use the @ sign to start it off?

this.(@ varname) = value;

The Evil Within 10-04-2006 12:36 PM

I was on RC when you posted this...why didn't you just ask me? Loser.

Although you wouldn't have gotten as good help, I actually like the way Skyld has it formatted better.

Skyld 10-04-2006 04:46 PM

Quote:

Originally Posted by _Z3phyr_ (Post 1225840)
So if I'm going to start the variable's name with the value of another variable, I need to use the @ sign to start it off?

this.(@ varname) = value;

I think you only need it for a variable name only or if a variable name is first.
PHP Code:

this.(@ foo "bar") = baz

However, I do it out of habit even when a string is first. It is probably good practice for consistency and legibility.

Chompy 10-05-2006 12:58 PM

I dunno why people are using makevar :p
-longer too write
-looks more complicated if you ask me, but isn't

PHP Code:

//#CLIENTSIDE
function onCreated()
{
  
temp."lol";
  
temp.(@ temp."lipop") = "hmm?";
  
player.chat temp.lollipop;


is lesser to write then:
PHP Code:

//#CLIENTSIDE
function onCreated()
{
  
temp."lol";
  
makevar("temp." temp."lipop") = "hmm?";
  
player.chat temp.lollipop;



xXziroXx 10-06-2006 01:52 PM

Ive actually started to use makevar() instead of var.(more stuff) lately. I like it more now, and it feels more.. organized?

_Z3phyr_ 10-07-2006 01:01 PM

*shrug* anyway instead of making a new thread how about I pose another question?

How does...
PHP Code:

if (playerleaves) { 

... translate into GS2?

I know it ain't
PHP Code:

function onPlayerleaves() { 

so what is it?!

Twinny 10-07-2006 05:35 PM

Quote:

Originally Posted by xXziroXx (Post 1226617)
Ive actually started to use makevar() instead of var.(more stuff) lately. I like it more now, and it feels more.. organized?

I always did var.(@ some @ "thing") but when i saw makevar() I thought i was doing it the wrong way >_<

_Z3phyr_ 10-09-2006 11:26 AM

So... >_>

_Z3phyr_ 10-19-2006 01:20 AM

*9 days later*
You guys suck

excaliber7388 10-19-2006 02:14 AM

nobody knows....


All times are GMT +2. The time now is 03:12 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.