Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Tiles You on (https://forums.graalonline.com/forums/showthread.php?t=67815)

ZeekTheMan2 08-02-2006 05:11 AM

Tiles You on
 
Ok i am making a movement system but i dont really now how to tell what part of the tileset you are on so i can make the player sit on a chair can any one help me

Angel_Light 08-02-2006 05:37 AM

i'm not positive but it's like

function onTimeout() {
if (ontiles(x,y) {
setani("sit","");
}
setTimer(0.05);
}

ZeekTheMan2 08-02-2006 05:44 AM

Quote:

Originally Posted by Angel_Light
i'm not positive but it's like

function onTimeout() {
if (ontiles(x,y) {
setani("sit","");
}
setTimer(0.05);
}

yes but what part of the tiles like what x and what y you are on i cant fingure that out .

KuJi 08-02-2006 06:39 AM

I do something similar to this:

PHP Code:

// INCOMPLETE CODE \\
this.tile tiletype(player.0.5player.y);
this.tile2 tiletype(player.1.5player.y);

if (
this.tile == && this.tile2 == 3) {
  
setani("sit"NULL);
} elseif (
this.tile == && this.tile2 == 4) {
  
setani("sleep"NULL);


I don't know all the tiletypes by heart, go test them out. mk :p

ZeekTheMan2 08-02-2006 07:06 AM

PHP Code:

//function onActionServerSide() {
if (params[0] == "walking") {
  
clientr.walking true;
}
if (
params[0] == "not walking") {
  
clientr.walking false;
}
//}
//#CLIENTSIDE

function onCreated() {
  
disabledefmovement();
  
this.walking 0;
  
this.speed .94568;
}
function 
onTimeout() {
 if (
clientr.walking == true){
  
client.walkingz --;
}
  if (
client.walkingz <= 0) {
    
triggeraction(00"serverside""-System_Movement""not walking");
    
setani("idle"NULL);
  }
  if (
keydown(0)) {
    
triggeraction(00"serverside""-System_Movement""walking");
    
player.-= this.speed;
    
player.dir 0;
    
setani("walk"NULL);
    
client.walkingz 2;
  }
  if (
keydown(2)) {
    
triggeraction(00"serverside""-System_Movement""walking");
    
player.+= this.speed;
    
player.dir 2;
    
setani("walk"NULL);
    
client.walkingz 2;
  }
  if (
keydown(1)) {
    
triggeraction(00"serverside""-System_Movement""walking");
    
player.-= this.speed;
    
player.dir 1;
    
setani("walk"NULL);
    
client.walkingz 2;
  }
  if (
keydown(3)) {
    
triggeraction(00"serverside""-System_Movement""walking");
    
player.+= this.speed;
    
player.dir 3;
    
setani("walk"NULL);
    
client.walkingz 2;
  }
  if (
onwater(player.1.5 + (vecx(player.dir)*0.1), player.+ (vecy(player.dir)*0.1))) {
    
setani("swim"NULL);
  }
  
this.tile tiletype(player.xplayer.y);
  
this.tile2 tiletype(player.1.5player.y);

  if (
this.tile == && this.tile2 == 3) {
    
setani("sit"NULL);
  }
  elseif (
this.tile == && this.tile2 == 4) {
    
setani("sleep"NULL);
  }
}
setTimer(0.05); 

So this is what i got now and i need a little help on the onwall stuff and yea kuji they work just the sit one is a little off though. And i well be making the grab stuff when i get the on wall stuff done

KuJi 08-02-2006 07:32 AM

Quote:

Originally Posted by ZeekTheMan2
PHP Code:

//function onActionServerSide() {
if (params[0] == "walking") {
  
clientr.walking true;
}
if (
params[0] == "not walking") {
  
clientr.walking false;
}
//}
//#CLIENTSIDE

function onCreated() {
  
disabledefmovement();
  
this.walking 0;
  
this.speed .94568;
}
function 
onTimeout() {
 if (
clientr.walking == true){
  
client.walkingz --;
}
  if (
client.walkingz <= 0) {
    
triggeraction(00"serverside""-System_Movement""not walking");
    
setani("idle"NULL);
  }
  if (
keydown(0)) {
    
triggeraction(00"serverside""-System_Movement""walking");
    
player.-= this.speed;
    
player.dir 0;
    
setani("walk"NULL);
    
client.walkingz 2;
  }
  if (
keydown(2)) {
    
triggeraction(00"serverside""-System_Movement""walking");
    
player.+= this.speed;
    
player.dir 2;
    
setani("walk"NULL);
    
client.walkingz 2;
  }
  if (
keydown(1)) {
    
triggeraction(00"serverside""-System_Movement""walking");
    
player.-= this.speed;
    
player.dir 1;
    
setani("walk"NULL);
    
client.walkingz 2;
  }
  if (
keydown(3)) {
    
triggeraction(00"serverside""-System_Movement""walking");
    
player.+= this.speed;
    
player.dir 3;
    
setani("walk"NULL);
    
client.walkingz 2;
  }
  if (
onwater(player.1.5 + (vecx(player.dir)*0.1), player.+ (vecy(player.dir)*0.1))) {
    
setani("swim"NULL);
  }
  
this.tile tiletype(player.xplayer.y);
  
this.tile2 tiletype(player.1.5player.y);

  if (
this.tile == && this.tile2 == 3) {
    
setani("sit"NULL);
  }
  elseif (
this.tile == && this.tile2 == 4) {
    
setani("sleep"NULL);
  }
}
setTimer(0.05); 


Is complaining about the script allowed or no :(?

ZeekTheMan2 08-02-2006 07:47 AM

go ahead i like to learn more anyways

KuJi 08-02-2006 04:13 PM

SO what I gave you = works nice?

ZeekTheMan2 08-02-2006 07:58 PM

Yes it works good

Yen 08-02-2006 08:08 PM

Do you understand how often you're sending a trigger to the server?
Don't complain when your server crashes. >_>

... Come to think of it, why would you want whether or not the player is walking handled on the serverside?

xAndrewx 08-02-2006 08:31 PM

Quote:

Originally Posted by Yen
Do you understand how often you're sending a trigger to the server?
Don't complain when your server crashes. >_>

... Come to think of it, why would you want whether or not the player is walking handled on the serverside?

I was thinking the same...

ZeekTheMan2 08-03-2006 03:02 AM

i was thinking of doing somthing else when the player is walking but never mind about the script kuji gave me one but i have another question is there any way to shoot particles affects to hit some one or do i need a ganis or somthing

KuJi 08-03-2006 03:42 AM

I didn't even understand the point of him commenting out the trigger on serverside o.o

contiga 08-03-2006 07:02 PM

And if you'd realy want a string with "walking" or "not walking", you can also use client. (being set clientside), which in this case, doesnt need to be secure.


All times are GMT +2. The time now is 08:28 AM.

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