Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Flags on GS2 - Simple question from a simpelton. (https://forums.graalonline.com/forums/showthread.php?t=69267)

Salaisuus 10-09-2006 02:58 AM

Flags on GS2 - Simple question from a simpelton.
 
Ok how do I output script that uses flags on gs2?
Like if I want to have npc to react to player if a flag is true.

PHP Code:

public function onCreated()
{
if (
strtofloat(#s(clientr.flaggy)) >= 2)
{
canbepushed;
}


Something like that tho ofcourse that doesnt work. :noob:

Yen 10-09-2006 03:22 AM

PHP Code:

function onCreated() {
  if (
clientr.flaggy >= 2) {
    
canbepushed();
  }


You should read a tutorial, check out the wiki.

Salaisuus 10-09-2006 05:05 AM

PHP Code:

function onCreated() { 
  if (
clientr.flaggy >= 2) { 
    
canbepushed(); 
  } 


Umm, I tried that, before and after your post.
It didnt work. :confused:

hotrian 10-09-2006 06:00 AM

//#CLIENTSIDE

or

findplayer(@player.account).clientr.flaggy

or so..?

Salaisuus 10-09-2006 07:29 AM

Clientside yes.
Tought it didnt need it because first I did it simply like this:

function onCreated() {
canbepushed();
}

without the clientside but still it worked.
(tho it still was clientside since other players could not see the npc move)
Od that it requires to be placed clientside when you ad a few lines or maybe I just dont get something...

Out of curiosity, can canbepushed() be used serverside at all?

Admins 10-09-2006 10:39 AM

The canbepushed-behaviour can easily be scripted though, then everyone can see it

Salaisuus 10-09-2006 07:18 PM

Quote:

The canbepushed-behaviour can easily be scripted though, then everyone can see it
Yup. I did that. Was just wondering.

_Z3phyr_ 10-15-2006 11:27 AM

Pardon this bump, por favor... but

I've spent the past ten minutes trying to do this allgededly easy thing, but for some reason I'm too stupid to make it work.

What's up?

Salaisuus 11-05-2006 03:56 AM

Ehh?
Well you must have got it by now but just incaise and because I've never
before been able to ansver questions here:

PHP Code:

function onActionpulled()
{
if (
player.dir 3)
{
player.-= 1;
-= 1;
}


Whee.
"This is the first time I've ever used my power to help some one... Its strange,
it feels... Kind of... Nice."

ApothiX 11-30-2006 04:42 PM

Quote:

Originally Posted by Salaisuus (Post 1239194)
Ehh?
Well you must have got it by now but just incaise and because I've never
before been able to ansver questions here:

PHP Code:

function onActionpulled()
{
if (
player.dir 3)
{
player.-= 1;
-= 1;
}


Whee.
"This is the first time I've ever used my power to help some one... Its strange,
it feels... Kind of... Nice."

PHP Code:

function onActionPulled() {
  
player.+= -vecx(player.dir);
  
player.+= -vecy(player.dir);
  
+= -vecx(player.dir);
  
+= -vecy(player.dir);


Would probably accomplish the same thing, without having 4 different if statements.

Skyld 11-30-2006 04:59 PM

Quote:

Originally Posted by ApothiX (Post 1248763)
PHP Code:

function onActionPulled() {
  
player.+= -vecx(player.dir);
  
player.+= -vecy(player.dir);
  
+= -vecx(player.dir);
  
+= -vecy(player.dir);


Would probably accomplish the same thing, without having 4 different if statements.

Not sure how well this would work?
PHP Code:

function onActionpulled()
{
  
this.player.+= -vecx(player.dir);
  
this.player.+= -vecy(player.dir);




All times are GMT +2. The time now is 11:24 AM.

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