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
  #1  
Old 06-11-2006, 09:19 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
Bomb class

X_X I know this is probably a simple syntax problem, but still:
Having trouble with these scripts, trying to make a bomb that works on gmaps.
Weapon:
PHP Code:
function onActionserverside()
{
  
putnpc2(playerx,playery,join("bomb"));
}
//#CLIENTSIDE
function onWeaponfired()
{
  
triggeraction(0,0,"serverside","Bomb test","bomb");

Class:
PHP Code:
function onCreated()
{
  
setshape(1,32,32);
  
showcharacter();
  
setcharani dr-bomb,;
  
settimer(3);
  
this.bx=x+1;
  
this.by=y+1;
}
function 
onTimeout()
{
  for(
this.i=0this.i<20this.i++)
  {
    
hitobjects(.5,this.bx,this.by);
    
hitobjects(.5,this.bx-this.i,this.by);
    
hitobjects(.5,this.bx+this.i,this.by);
    
hitobjects(.5,this.bx,this.by-this.i);
    
hitobjects(.5,this.bx,this.by+this.i);
  }

Reply With Quote
  #2  
Old 06-11-2006, 09:25 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
putnpc2(posx, posy, "code");

In this case:

putnpc2(player.x, player.y, "join bomb;");

Also, it's setcharani("ani", "params");
__________________
Skyld
Reply With Quote
  #3  
Old 06-11-2006, 09:36 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
And now that I think of it, this is a pretty crappy script, first off, I forgot destroy (now I have explosions sitting in main), I cannot lift this, without it looking like a person, explosions don't set other bombs off, AND, it doesn't do damage. Help?
Reply With Quote
  #4  
Old 06-12-2006, 06:04 PM
excaliber7388 excaliber7388 is offline
Banned
excaliber7388's Avatar
Join Date: Jul 2005
Location: US
Posts: 5,229
excaliber7388 can only hope to improve
Send a message via AIM to excaliber7388
How could you make it so when the bomb is lifted, it keeps the gani of a bomb, and it does not explode. For not explode I'm thinking of testing if it's being carried (I forget, can I do this?) and then putting the tieout in a loop untill dropped. This would probably work for the gani as well. I have also realized that the bomb is only able to cause damage off the gmap. Why?
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 01:01 AM.


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