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 08-02-2006, 05:11 AM
ZeekTheMan2 ZeekTheMan2 is offline
Zeek Is The Man
ZeekTheMan2's Avatar
Join Date: Feb 2006
Location: Ohio
Posts: 12
ZeekTheMan2 is on a distinguished road
Send a message via AIM to ZeekTheMan2
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
Reply With Quote
  #2  
Old 08-02-2006, 05:37 AM
Angel_Light Angel_Light is offline
Varia Developer
Angel_Light's Avatar
Join Date: Nov 2005
Location: Knoxville, TN
Posts: 1,684
Angel_Light is on a distinguished road
Send a message via AIM to Angel_Light Send a message via MSN to Angel_Light
i'm not positive but it's like

function onTimeout() {
if (ontiles(x,y) {
setani("sit","");
}
setTimer(0.05);
}
__________________
Deep into the Darkness peering...
Reply With Quote
  #3  
Old 08-02-2006, 05:44 AM
ZeekTheMan2 ZeekTheMan2 is offline
Zeek Is The Man
ZeekTheMan2's Avatar
Join Date: Feb 2006
Location: Ohio
Posts: 12
ZeekTheMan2 is on a distinguished road
Send a message via AIM to ZeekTheMan2
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 .
Reply With Quote
  #4  
Old 08-02-2006, 06:39 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
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
Reply With Quote
  #5  
Old 08-02-2006, 07:06 AM
ZeekTheMan2 ZeekTheMan2 is offline
Zeek Is The Man
ZeekTheMan2's Avatar
Join Date: Feb 2006
Location: Ohio
Posts: 12
ZeekTheMan2 is on a distinguished road
Send a message via AIM to 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); 
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

Last edited by ZeekTheMan2; 08-02-2006 at 07:07 AM.. Reason: spelling error
Reply With Quote
  #6  
Old 08-02-2006, 07:32 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
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 ?
Reply With Quote
  #7  
Old 08-02-2006, 07:47 AM
ZeekTheMan2 ZeekTheMan2 is offline
Zeek Is The Man
ZeekTheMan2's Avatar
Join Date: Feb 2006
Location: Ohio
Posts: 12
ZeekTheMan2 is on a distinguished road
Send a message via AIM to ZeekTheMan2
go ahead i like to learn more anyways
Reply With Quote
  #8  
Old 08-02-2006, 04:13 PM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
SO what I gave you = works nice?
Reply With Quote
  #9  
Old 08-02-2006, 07:58 PM
ZeekTheMan2 ZeekTheMan2 is offline
Zeek Is The Man
ZeekTheMan2's Avatar
Join Date: Feb 2006
Location: Ohio
Posts: 12
ZeekTheMan2 is on a distinguished road
Send a message via AIM to ZeekTheMan2
Yes it works good
Reply With Quote
  #10  
Old 08-02-2006, 08:08 PM
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
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?
Reply With Quote
  #11  
Old 08-02-2006, 08:31 PM
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 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...
__________________
Reply With Quote
  #12  
Old 08-03-2006, 03:02 AM
ZeekTheMan2 ZeekTheMan2 is offline
Zeek Is The Man
ZeekTheMan2's Avatar
Join Date: Feb 2006
Location: Ohio
Posts: 12
ZeekTheMan2 is on a distinguished road
Send a message via AIM to ZeekTheMan2
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
Reply With Quote
  #13  
Old 08-03-2006, 03:42 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
I didn't even understand the point of him commenting out the trigger on serverside o.o
Reply With Quote
  #14  
Old 08-03-2006, 07:02 PM
contiga contiga is offline
Graal2001 Administration
contiga's Avatar
Join Date: Jul 2004
Location: Netherlands
Posts: 419
contiga is an unknown quantity at this point
Send a message via ICQ to contiga Send a message via AIM to contiga Send a message via MSN to contiga Send a message via Yahoo to contiga
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.
__________________
AIM: Contiga122
MSN: [email protected]
Status:
Quote:
Originally Posted by unixmad View Post
I am also awake 3AM to help correct problems.
Quote:
Originally Posted by Bomy Island RC people
Daniel: HoudiniMan is a bad guy =p
*Bell: rofl. I first read that as houdini is a bad man. like the little kid that wants his mommy to keep her away from that boogie man
Daniel: xD
*Rufus: I wouldn't want my kids around him.
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 01:09 AM.


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