Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Custom bombs / images? (https://forums.graalonline.com/forums/showthread.php?t=134265556)

Alpho 01-11-2012 02:25 AM

Custom bombs / images?
 
Hi i'm trying to create a custom bomb system on Esteria and I was wondering how I could customize putbomb? I tried Putbomb2 and it seems to only place a shadow. Any ideas? thanks!

Edit:
Script help for 'putbomb2':
TServerLevel.putbomb2(int, float, float, str) - adds a classic bomb with the specified power, x, y and image (default bomb1.png)

When trying that, when I try making it our bomb image, it defaults to a shadow.

fowlplay4 01-11-2012 03:05 AM

Are you calling it on the server-side?

Please post your actual code so we can help debug it for you.

Alpho 01-11-2012 03:14 AM

Well for now, i'm just trying a normal bomb onCreated,
PHP Code:

//#CLIENTSIDE
function onCreated() {
   
putbomb2("bomb1.png",30,30);


edit, sorry heres my script:
PHP Code:

//#CLIENTSIDE 
function onCreated() { 
   
putbomb2(2,30,30"bomb1.png"); 



fowlplay4 01-11-2012 03:24 AM

I believe putbomb2 version you're trying to use is server-side only.

Try:

PHP Code:

function onActionServerSide() {
  if (
params[0] == "bomb") {
    
// This should work
    
player.level.putbomb2(23030"bomb1.png");
    
// This also might work
    
putbomb2(23032"bomb1.png");
  }
}

//#CLIENTSIDE
function onCreated() {
  
triggerserver("gui"this.name"bomb");



Alpho 01-11-2012 03:33 AM

Quote:

Originally Posted by fowlplay4 (Post 1681490)
I believe putbomb2 version you're trying to use is server-side only.

Try:

PHP Code:

function onActionServerSide() {
  if (
params[0] == "bomb") {
    
// This should work
    
player.level.putbomb2(23030"bomb1.png");
    
// This also might work
    
putbomb2(23032"bomb1.png");
  }
}

//#CLIENTSIDE
function onCreated() {
  
triggerserver("gui"this.name"bomb");



Your script actually works clientside, thank you!

fowlplay4 01-11-2012 04:08 AM

Quote:

Originally Posted by Alpho (Post 1681491)
Your script actually works clientside, thank you!

Great.

Please post the final working script for others who may have the issue in the future.

Alpho 01-13-2012 01:10 AM

Quote:

Originally Posted by fowlplay4 (Post 1681492)
Please post the final working script for others who may have the issue in the future.

PHP Code:

//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "/bombtest") {
    
putbomb2(1player.xplayer.y"bomb1.png");
  }



Astram 01-21-2012 04:25 AM

Or for even more customization you can make a class for each bomb and lay a class in the level and have it wait a few seconds and the bomb explodes :D

fowlplay4 01-21-2012 05:17 AM

Quote:

Originally Posted by Astram (Post 1682276)
Or for even more customization you can make a class for each bomb and lay a class in the level and have it wait a few seconds and the bomb explodes :D

Which is overkill if the default system suits your needs.

Hezzy002 01-21-2012 09:29 PM

Quote:

Originally Posted by fowlplay4 (Post 1682278)
Which is overkill if the default system suits your needs.

*cough*iPhone Graal*cough*

Ugliest bomb system known to man, and they don't even predict the bomb placement clientside. Even my custom bomb system did that on Graal 2.17.

gg, iPhone scripters.


All times are GMT +2. The time now is 09:56 PM.

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