Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-28-2014, 01:57 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
updateboard question

Okay, so I am working on a shovel. I am trying to make it place tiles in the level where I dig. I wan't them to wait so long then disappear. The problem is that they only seem to disappear if I replace the tiles for blank grass 2047 I think it is. If I place my tiles over any other tile they do not automatically disappear. Is there any trick to making the tiles revert after a set amount of time? I was thinking I could just re-replace the tiles but then it gets mad ugly when the player leaves the level because then your not in the same level and they don't end up getting reverted back ect.

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);

Reply With Quote
  #2  
Old 10-28-2014, 05:00 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: 353
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
hello!

you should consider dropping a dirt npc on serverside instead, that way it can be made to either fade or transition out rather than disappear at once, plus there are ways to create the illusion of no lag if you make the player do a showani()/showimg() on clientside when triggering to serverside, then have that display disappear as soon as the npc they are the placer of appears on their client. dirtholes can then be checked for using findareanpcs(); which if it contains other non dirthole npcs you will probably want to trigger an event such as 'onDig' on them anyway
__________________
This signature has been deleted by Darlene159.
Reply With Quote
  #3  
Old 10-28-2014, 11:10 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 Jakov_the_Jakovasaur View Post
hello!

you should consider dropping a dirt npc on serverside instead, that way it can be made to either fade or transition out rather than disappear at once, plus there are ways to create the illusion of no lag if you make the player do a showani()/showimg() on clientside when triggering to serverside, then have that display disappear as soon as the npc they are the placer of appears on their client. dirtholes can then be checked for using findareanpcs(); which if it contains other non dirthole npcs you will probably want to trigger an event such as 'onDig' on them anyway
Does this cause conflict if I use putnpc() twice on the same area? Will the dirt hole ever cover up the item you are digging up? For example, digging up a defaulat gralat using join(); to its default class.
Reply With Quote
  #4  
Old 10-28-2014, 11:37 AM
Inari Inari is offline
Registered User
Join Date: Sep 2014
Posts: 47
Inari is on a distinguished road
Well the dirt hole would be draw-under-player?
Reply With Quote
  #5  
Old 10-28-2014, 12:18 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 Inari View Post
Well the dirt hole would be draw-under-player?
This. Also, upon creation, check if there's already a dirt hole at that same position, and just make the NPC destroy itself if that's the case.
__________________
Reply With Quote
  #6  
Old 10-28-2014, 10:21 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: 353
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
Does this cause conflict if I use putnpc() twice on the same area? Will the dirt hole ever cover up the item you are digging up? For example, digging up a defaulat gralat using join(); to its default class.
you can check on both clientside and serverside using findareanpcs() to see if such a dirthole npc already exists, and just avoid placing it if one does
__________________
This signature has been deleted by Darlene159.
Reply With Quote
  #7  
Old 10-29-2014, 01:02 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 Jakov_the_Jakovasaur View Post
you can check on both clientside and serverside using findareanpcs() to see if such a dirthole npc already exists, and just avoid placing it if one does
My question is digging a hole... and an object.. puts 2 putnpc2 in the exact spot.. now on GK this proved my theory that in some cases the putnpc2's show on top of each other in different orders for no apparent reason. It's to my understanding that the only way to persistently show them correctly is in a gang, via gani script so that you can grab the item, before the hole dissapears.
Reply With Quote
  #8  
Old 10-29-2014, 05:56 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: 353
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
My question is digging a hole... and an object.. puts 2 putnpc2 in the exact spot.. now on GK this proved my theory that in some cases the putnpc2's show on top of each other in different orders for no apparent reason. It's to my understanding that the only way to persistently show them correctly is in a gang, via gani script so that you can grab the item, before the hole dissapears.
putting drawunderplayer() on the dirt hole should work, if you need to use drawunderplayer() on the item as well and it uses a bounce effect similar to default rupees, modify z in a scripted animation rather than y or place it inside a normal gani
__________________
This signature has been deleted by Darlene159.
Reply With Quote
  #9  
Old 10-29-2014, 07:57 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
But you really shouldnt have to draw the item
Under the player, that would just be weird.
__________________
~Delteria Support
~Playerworld Support
~PWA Chief
http://support.toonslab.com
[email protected]



Reply With Quote
  #10  
Old 10-29-2014, 04:01 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
Create a new gani and add a param for the dirt image and one for the item icon.
__________________
Reply With Quote
  #11  
Old 10-29-2014, 04:45 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: 353
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 MysticalDragon View Post
But you really shouldnt have to draw the item
Under the player, that would just be weird.
i know, it was hypothetical
__________________
This signature has been deleted by Darlene159.
Reply With Quote
  #12  
Old 10-29-2014, 04:56 PM
Inari Inari is offline
Registered User
Join Date: Sep 2014
Posts: 47
Inari is on a distinguished road
Quote:
Originally Posted by scriptless View Post
My question is digging a hole... and an object.. puts 2 putnpc2 in the exact spot.. now on GK this proved my theory that in some cases the putnpc2's show on top of each other in different orders for no apparent reason. It's to my understanding that the only way to persistently show them correctly is in a gang, via gani script so that you can grab the item, before the hole dissapears.
Shouldn't they be
Dirt hole => under player
Object => same layer as player
?
Reply With Quote
  #13  
Old 10-29-2014, 05:10 PM
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
Quote:
Originally Posted by Inari View Post
Shouldn't they be
Dirt hole => under player
Object => same layer as player
?
y when u can just use a gani...
Reply With Quote
  #14  
Old 10-29-2014, 05:18 PM
Inari Inari is offline
Registered User
Join Date: Sep 2014
Posts: 47
Inari is on a distinguished road
Quote:
Originally Posted by Cubical View Post
y when u can just use a gani...
Not sure, seems cleaner, since "object" can be a lot of things: a rupee, a bomb (that about to explode), etc.
Reply With Quote
  #15  
Old 10-30-2014, 01:24 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 Inari View Post
Not sure, seems cleaner, since "object" can be a lot of things: a rupee, a bomb (that about to explode), etc.
Yeah, thats why things are kinda difficult. It would be super cool if I could just have tiles that are not 2047 revert back to normal.. but the only tiles that the whole disappears from are ones that were entirely those tiles. So tiles like 0, and 1 would not be changed back for some reason. Thats the only problem I am having with the method I am using....lag is more like an eh not an issue but the fact it won't change back for some tiles at all even after 18 hours.. yeah thats not lag at all.. =/
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 03:50 PM.


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