Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-09-2006, 02:58 AM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
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.
Reply With Quote
  #2  
Old 10-09-2006, 03:22 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
PHP Code:
function onCreated() {
  if (
clientr.flaggy >= 2) {
    
canbepushed();
  }

You should read a tutorial, check out the wiki.
Reply With Quote
  #3  
Old 10-09-2006, 05:05 AM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
PHP Code:
function onCreated() { 
  if (
clientr.flaggy >= 2) { 
    
canbepushed(); 
  } 

Umm, I tried that, before and after your post.
It didnt work.
Reply With Quote
  #4  
Old 10-09-2006, 06:00 AM
hotrian hotrian is offline
Who?
Join Date: May 2003
Location: Eatonville, Washington, 98328
Posts: 56
hotrian is on a distinguished road
Send a message via AIM to hotrian Send a message via MSN to hotrian
//#CLIENTSIDE

or

findplayer(@player.account).clientr.flaggy

or so..?
__________________
Sometimes I wonder if I think too big.
Quote:
Originally Posted by Admins
I've moved the fox map to "levelstoobig/" because a terrain gmap of 1024x1024 levels is clearly too huge (the kingdoms main map is 40x40 and is already quite big). It was taking a lot of memory and was slowing down the computer.
Reply With Quote
  #5  
Old 10-09-2006, 07:29 AM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
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?
Reply With Quote
  #6  
Old 10-09-2006, 10:39 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
The canbepushed-behaviour can easily be scripted though, then everyone can see it
Reply With Quote
  #7  
Old 10-09-2006, 07:18 PM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
Quote:
The canbepushed-behaviour can easily be scripted though, then everyone can see it
Yup. I did that. Was just wondering.
Reply With Quote
  #8  
Old 10-15-2006, 11:27 AM
_Z3phyr_ _Z3phyr_ is offline
Banned
Join Date: Sep 2003
Location: Louisiane
Posts: 390
_Z3phyr_ is an unknown quantity at this point
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?
Reply With Quote
  #9  
Old 11-05-2006, 03:56 AM
Salaisuus Salaisuus is offline
Registered User
Join Date: Mar 2004
Posts: 68
Salaisuus is on a distinguished road
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."
Reply With Quote
  #10  
Old 11-30-2006, 04:42 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Salaisuus View Post
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.
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote
  #11  
Old 11-30-2006, 04:59 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 ApothiX View Post
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);

__________________
Skyld
Reply With Quote
Reply


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 06:34 PM.


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