Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 10-30-2014, 07:55 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
You can check out the "object" class in my Atlantis dump for something like this. I switch out tiles both on the serverside and clientside there to get a smoother experience. It's a bit more restrictive (bushes/stones/... sitting on top of the tiles) and therefore easier to control than your shovel stuff, though, but maybe it'll give you a few ideas. One thing to keep in mind: when using updateboard(), update a region larger than 2 by 2, no matter how many tiles you actually changed. Stefan added some "optimization" to the server at some point that can really **** up your tile handling when you're updating a 2 by 2 region.
__________________
Reply With Quote
  #17  
Old 10-30-2014, 09:07 AM
Cubical Cubical is offline
Banned
Join Date: Feb 2007
Posts: 1,348
Cubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant futureCubical has a brilliant future
bro... ganis.. not hard
Reply With Quote
  #18  
Old 10-30-2014, 03:24 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 xAndrewx View Post
Create a new gani and add a param for the dirt image and one for the item icon.
this.
__________________
Reply With Quote
  #19  
Old 10-30-2014, 03:34 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by xAndrewx View Post
this.
No need to alienate things.
__________________
Reply With Quote
  #20  
Old 10-30-2014, 04:13 PM
Inari Inari is offline
Registered User
Join Date: Sep 2014
Posts: 47
Inari is on a distinguished road
Quote:
Originally Posted by xAndrewx View Post
this.
So, now you want to make a bomb that explodes?
Reply With Quote
  #21  
Old 10-31-2014, 02:59 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by Crow View Post
You can check out the "object" class in my Atlantis dump for something like this. I switch out tiles both on the serverside and clientside there to get a smoother experience. It's a bit more restrictive (bushes/stones/... sitting on top of the tiles) and therefore easier to control than your shovel stuff, though, but maybe it'll give you a few ideas. One thing to keep in mind: when using updateboard(), update a region larger than 2 by 2, no matter how many tiles you actually changed. Stefan added some "optimization" to the server at some point that can really **** up your tile handling when you're updating a 2 by 2 region.
I think I did read that he made some optimizations. And he made a command on bush's specifically and being able to regrow them via script or something if I am not mistaken? However on a gmap, how do the x/y work for update board? Are they 0 to 64 or are they 0 to 64 * levels?
Reply With Quote
  #22  
Old 10-31-2014, 06:17 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by scriptless View Post
I think I did read that he made some optimizations. And he made a command on bush's specifically and being able to regrow them via script or something if I am not mistaken? However on a gmap, how do the x/y work for update board? Are they 0 to 64 or are they 0 to 64 * levels?
Not sure. I'm just using this.x and this.y in Atlantis' "object" class. Can't remember if that's the global or local coordinates.
__________________
Reply With Quote
  #23  
Old 10-31-2014, 04:30 PM
Jakov_the_Jakovasaur Jakov_the_Jakovasaur is offline
Deleted by Darlene159
Jakov_the_Jakovasaur's Avatar
Join Date: Sep 2013
Location: Deleted by Darlene159
Posts: 354
Jakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud of
use map coordinates
__________________
This signature has been deleted by Darlene159.
Reply With Quote
  #24  
Old 11-01-2014, 08:29 AM
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
would be interesting to see your work around
__________________
Reply With Quote
  #25  
Old 11-02-2014, 02:45 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by xAndrewx View Post
would be interesting to see your work around
who's workaround? I figure I'm gonna need to check tiles, and npc's.. this is going to be fun.
Reply With Quote
  #26  
Old 11-03-2014, 04:00 AM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Okay, so this is giving me problems... more specifically its making npc's a good distance away say "Hit".. It's in the weapon npc... cx/cy are the cordinate x and y that I want to check at.. (top left of the hole dug).. Should be 2x2 tiles. But this seems to affect npc's further away.

PHP Code:
  for(temp.findareanpcs(this.cxthis.cythis.cx 1this.cy 1)){
    
temp.n.chat "Hit!";
  } 
It's giving it a huge gap between the npc I dug and the ones around it... :x

Edit:

Okay, sorry I guess thats x/y/w/h I needed to just supply 2,2 for the width,height... for some reason I was entering ending x/y cords. My bad, sorry.

However, gralats have not been showing for me on this server or my personal dev server unless I first logon UN... anyone know why this is? I would have thought a newly bought server would be working, is it missing some file?

Last edited by scriptless; 11-03-2014 at 05:06 AM..
Reply With Quote
  #27  
Old 11-03-2014, 06:08 AM
Jakov_the_Jakovasaur Jakov_the_Jakovasaur is offline
Deleted by Darlene159
Jakov_the_Jakovasaur's Avatar
Join Date: Sep 2013
Location: Deleted by Darlene159
Posts: 354
Jakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud of
Quote:
Originally Posted by scriptless View Post
Okay, so this is giving me problems... more specifically its making npc's a good distance away say "Hit".. It's in the weapon npc... cx/cy are the cordinate x and y that I want to check at.. (top left of the hole dug).. Should be 2x2 tiles. But this seems to affect npc's further away.

PHP Code:
  for(temp.findareanpcs(this.cxthis.cythis.cx 1this.cy 1)){
    
temp.n.chat "Hit!";
  } 
It's giving it a huge gap between the npc I dug and the ones around it... :x

Edit:

Okay, sorry I guess thats x/y/w/h I needed to just supply 2,2 for the width,height... for some reason I was entering ending x/y cords. My bad, sorry.
looking at the original script:

Quote:
Originally Posted by scriptless View Post

PHP Code:
//#CLIENTSIDE
function onCreated() {
  
this.player.1.0 vecx(player.dir) * 2;
  
this.player.1.0 vecy(player.dir) * 2;
  for ( 
this.iy 0this.iy 2this.iy ++ ) {
    for ( 
this.ix 0this.ix 2this.ix ++ ) {
      
this.checkX this.x+this.ix;
      
this.checkY this.y+this.iy;
      
tiles[this.checkXthis.checkY] = this.replaceTiles[this.ix+this.iy*2];
    }
  }
  
updateboard(this.x,this.y,2,2);

is there still not a break; for when 4 grass tiles have been detected on clientside?

if not then it could be triggering to the server up to 4 times and ultimately checking a larger region on serverside than necessary
__________________
This signature has been deleted by Darlene159.
Reply With Quote
  #28  
Old 11-03-2014, 08:43 AM
MysticalDragon MysticalDragon is offline
Global Administration
MysticalDragon's Avatar
Join Date: Oct 2002
Location: Lynn Ma
Posts: 883
MysticalDragon is just really niceMysticalDragon is just really nice
Send a message via AIM to MysticalDragon Send a message via MSN to MysticalDragon
Quote:
Originally Posted by scriptless View Post
Okay, so this is giving me problems... more specifically its making npc's a good distance away say "Hit".. It's in the weapon npc... cx/cy are the cordinate x and y that I want to check at.. (top left of the hole dug).. Should be 2x2 tiles. But this seems to affect npc's further away.

PHP Code:
  for(temp.findareanpcs(this.cxthis.cythis.cx 1this.cy 1)){
    
temp.n.chat "Hit!";
  } 
It's giving it a huge gap between the npc I dug and the ones around it... :x

Edit:

Okay, sorry I guess thats x/y/w/h I needed to just supply 2,2 for the width,height... for some reason I was entering ending x/y cords. My bad, sorry.

However, gralats have not been showing for me on this server or my personal dev server unless I first logon UN... anyone know why this is? I would have thought a newly bought server would be working, is it missing some file?
Utilize f2 to see if there is any missing files
__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]



Reply With Quote
  #29  
Old 11-03-2014, 09:27 AM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
findareanpcs(x, y) returns a list of npc id's, not a list of a TServerNPC objects.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #30  
Old 11-03-2014, 12:04 PM
scriptless scriptless is offline
Banned
Join Date: Dec 2008
Location: N-Pulse
Posts: 1,412
scriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to beholdscriptless is a splendid one to behold
Quote:
Originally Posted by Jakov_the_Jakovasaur View Post
looking at the original script:



is there still not a break; for when 4 grass tiles have been detected on clientside?

if not then it could be triggering to the server up to 4 times and ultimately checking a larger region on serverside than necessary
Sorry, I should have posted whole script so far.. Instead of using breaks, I used return's from different functions.

Quote:
Originally Posted by MysticalDragon View Post
Utilize f2 to see if there is any missing files
I didn't see anything in f2, I already checked. Plus I did "/find *gralat*" and it only found the gani. So I uploaded gralats.png but it still didn't work.
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 11:57 AM.


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