Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Need some advice (https://forums.graalonline.com/forums/showthread.php?t=134268100)

Gunderak 04-17-2013 12:19 PM

Need some advice
 
Hi, my aim on my server is to make it like Terraria.
Iv'e built a weapon to destroy tiles and it shows a nice effect when destroying too, but iv'e come across a problem.
If you aren't aware, Terraria destroys tiles, destroying tiles in Graal; while possible, it doesn't save immediately.
This is the serverside part.
PHP Code:

    temp.params[1];
    
temp.params[2];
    
temp.old tiles[xy];
    if(
old == 511) return;
    
tiles[xy] = 511;
    
temp.npc putnpc2(xynull);
    
temp.npc.join("destroy");
    
updateboard2(xy11);
    
savelevel(player.level); 

I don't think there's anything wrong with that, the tiles do show as the new ones immediately, similar to the online tile editor, but is there any way to get them to save to the file too?
Another issue is players on other levels, when they enter your level (on the gmap) they see the old tiles.
Would it be easier to just have hundreds of putnpc2's placed that act as the games tiles? or would this lag?

DrakilorP2P 04-17-2013 10:13 PM

I think if you add savelevels=true in serveroptions it'll save to the file.

Having an NPC for each tile would probably lag, though I haven't tried it. I'm not sure if you can do Terraria in Graal without lag but you can try I guess.

Gunderak 04-18-2013 02:41 AM

All that is set, and it does save after about 5 minutes, but then the tiles don't show to other players until I write "update level".


All times are GMT +2. The time now is 09:18 AM.

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