Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-03-2006, 12:51 AM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
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.
Reply With Quote
  #2  
Old 10-03-2006, 02:04 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
What you're doing should work.
Reply With Quote
  #3  
Old 10-04-2006, 05:38 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
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..
__________________
Quote:
Reply With Quote
  #4  
Old 10-04-2006, 08:20 AM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Quote:
Originally Posted by fowlplay4 View Post
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); =(
__________________
Reply With Quote
  #5  
Old 10-04-2006, 09:11 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by xAndrewx View Post
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.
Reply With Quote
  #6  
Old 10-04-2006, 09:37 AM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
Quote:
Originally Posted by Skyld View Post
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;
Reply With Quote
  #7  
Old 10-04-2006, 04:46 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by _Z3phyr_ View Post
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.
Reply With Quote
  #8  
Old 10-04-2006, 12:36 PM
The Evil Within The Evil Within is offline
I'm Not Chance...Really
The Evil Within's Avatar
Join Date: Aug 2004
Location: Coral Springs, Florida
Posts: 65
The Evil Within is on a distinguished road
Send a message via AIM to The Evil Within
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.
__________________
-CMercy

Delteria Forums
Reply With Quote
  #9  
Old 10-05-2006, 12:58 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
I dunno why people are using makevar
-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;

__________________
Reply With Quote
  #10  
Old 10-06-2006, 01:52 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Ive actually started to use makevar() instead of var.(more stuff) lately. I like it more now, and it feels more.. organized?
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #11  
Old 10-07-2006, 05:35 PM
Twinny Twinny is offline
My empire of dirt
Twinny's Avatar
Join Date: Mar 2006
Location: Australia
Posts: 2,422
Twinny is just really niceTwinny is just really nice
Send a message via AIM to Twinny
Quote:
Originally Posted by xXziroXx View Post
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
Reply With Quote
  #12  
Old 10-07-2006, 01:01 PM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
*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?!
Reply With Quote
  #13  
Old 12-28-2006, 04:00 PM
godofwarares godofwarares is offline
Webmaster
godofwarares's Avatar
Join Date: Dec 2006
Location: Florida
Posts: 552
godofwarares is on a distinguished road
Send a message via ICQ to godofwarares Send a message via AIM to godofwarares Send a message via MSN to godofwarares Send a message via Yahoo to godofwarares
Quote:
Originally Posted by _Z3phyr_ View Post
*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?!
Since GS2 is function onEVENTNAME(params) {

It would be

PHP Code:
function onPlayerLeaves() {
// ...

Quote:
Originally Posted by _Z3phyr_ View Post
I know it ain't
PHP Code:
function onPlayerleaves() { 
It has to be :P
Playerleaves is an event, and read above :P
Reply With Quote
  #14  
Old 10-09-2006, 11:26 AM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
So... >_>
Reply With Quote
  #15  
Old 10-19-2006, 01:20 AM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
*9 days later*
You guys suck
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:20 AM.


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