Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Tech Support (https://forums.graalonline.com/forums/forumdisplay.php?f=7)
-   -   Gralats and Bombs (https://forums.graalonline.com/forums/showthread.php?t=87434)

Matt 08-17-2009 12:17 AM

Gralats and Bombs
 
My problem is that Gralats and Bombs are not being put on the the gmap when used. Bombs just don't show anymore, and when dropping Gralats, the gralat chargani isn't being set at all.

Suggestions?

DustyPorViva 08-17-2009 01:49 AM

For bombs:
PHP Code:

function onWeaponfired() {
  
freezeplayer(.1);
  
setani("lay",null);
  
temp.layx player.int(player.x/64)*64 .5 vecx(player.dir)*2;
  
temp.layy player.int(player.y/64)*64 vecy(player.dir)*2;
  
putbomb(1,this.layx,this.layy);


For gralats, Stefan enabled functions for detecting when things like gralats and hearts and such are dropped, so that you can replace them easily with your own NPCs(like the scripted gralats do).

Matt 08-17-2009 02:39 AM

My talent with Scripting is garbage, so bare with me. So i replaced the current Bomb 'WEAPON' script with what's shown above, but no bombs are removed from current amount, nor is the bomb placed. Possible gani problem (Considering i don't see 'lay' in the ganis folder)?

DustyPorViva 08-17-2009 02:44 AM

Well it has to be clientside, with this:
//#CLIENTSIDE
at the top, and then player.bombs--; should suffice to deplete bombs. Also...
The first if checks if the player's bombs are at 0, if they are, it returns and therefor stops the rest of the function from being executed.
PHP Code:

//#CLIENTSIDE
function onWeaponfired() {
  if (
player.bombs <= 0) return;
  
player.bombs--;
  
freezeplayer(.1);
  
setani("lay",null);
  
temp.layx player.int(player.x/64)*64 .5 vecx(player.dir)*2;
  
temp.layy player.int(player.y/64)*64 vecy(player.dir)*2;
  
putbomb(1,layx,layy);



Matt 08-17-2009 02:59 AM

Also no good, the gani is performed, and everything else, but the bomb does not appear.

Edit: Apparently everyone cannot see their own bombs, only others.

DustyPorViva 08-17-2009 03:06 AM

Sorry, I've edited it. Try it now?

Matt 08-17-2009 03:45 AM

That did the trick, thanks. ^^

Would you happen to have the default gralat script?

cyan3 08-17-2009 03:49 AM

Quote:

Originally Posted by Matt (Post 1515416)
That did the trick, thanks. ^^

Would you happen to have the default gralat script?

Here is the default gralat script.

PHP Code:

function onCreated() {

  
showcharacter();

  
updategani();

}

function 
onUpdategani() {

  
updategani();

}

function 
updategani() {

  
temp.type 1;

  if (
rupees>=100temp.type 4;

  else if (
rupees>=30temp.type 3;

  else if (
rupees>=5temp.type 2;

  
setcharani("gralats"temp.type);

}

function 
onPlayerTouchsMe() {

  
player.rupees += rupees;

  
rupees 0;

  
destroy();




Matt 08-17-2009 03:54 AM

Well i replaced our current one (Had a mix of GS1 and GS2 i noticed) with this one you just posted, but no fix. The Rupee drops, but the gani still isn't being set.

EDIT: Restarting the NPC-Server after adding the script provided above worked, thanks for you help guys, appreciate it. :)

Switch 08-17-2009 06:20 PM

Quote:

Originally Posted by Matt (Post 1515398)
Possible gani problem (Considering i don't see 'lay' in the ganis folder)?

For future reference, Ganis like "idle", "grab", "push", "swim", etc. are default Gani files and don't need to be put in the filebrowser unless changed (which shouldn't be done; a server should have their own Gani name and use replaceAni(old,new))


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

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