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)

Gambet 12-20-2006 10:00 PM

Quote:

Originally Posted by Andy0687 (Post 1255612)
Rambling



I don't know what his intentions were, but he put it off as a challenge. Sort of like seeing if people know how to do something, without doing it the way he's done it.

That's the only reason I responded the way I did, else, I'd be glad to help.

_Z3phyr_ 12-20-2006 11:49 PM

This stuff
PHP Code:

function onTimeout() {
  for (
i=0;i<=2;i++) {
    
player.x+=i;
  }
  
this.setTimer(.5);


only moves me by whatever i is set to (in this case 0 tiles), so it doesn't work (I said it because it doesn't work -- as a tip that its not the right answer).

And how about an answer in GS2? English doesn't really help me.

godofwarares 12-28-2006 04:00 PM

Quote:

Originally Posted by _Z3phyr_ (Post 1227123)
*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_ (Post 1227123)
I know it ain't
PHP Code:

function onPlayerleaves() { 


It has to be :P
Playerleaves is an event, and read above :P

godofwarares 01-08-2007 09:59 PM

Quote:

Originally Posted by _Z3phyr_ (Post 1255770)
This stuff
PHP Code:

function onTimeout() {
  for (
i=0;i<=2;i++) {
    
player.x+=i;
  }
  
this.setTimer(.5);


only moves me by whatever i is set to (in this case 0 tiles), so it doesn't work (I said it because it doesn't work -- as a tip that its not the right answer).

And how about an answer in GS2? English doesn't really help me.

Why not just do a for loop that increses the player's X position?

Example:

PHP Code:

function onPlayerTouchsMe()
{

  for ( 
0<= 2i++ )
  {

    
player.x++;

  }



Makes much more sense :)


All times are GMT +2. The time now is 02:17 PM.

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