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-20-2010, 12:09 AM
qw3rt qw3rt is offline
qW£rt Classic Iphone
qw3rt's Avatar
Join Date: Jun 2010
Location: France
Posts: 34
qw3rt is an unknown quantity at this point
Lay Items Problem

Hi

I would liked to script a simple baddy but i have a problem,i'm sure its simple but i can't find a solution

PHP Code:
if (timeout && this.mode==4) {
  
random(0,100);
  if (
i<50lay bombslay bombs;
  if (
i>50lay darts
that's a part of the script its about when the baddy die i would like it lays bombs or arrows.

It works, but the problem is it lay 1 bombs icon and when i take it, it gives me 10 bombs.
Me I would like it lay ,instead of 1bombs icons and 10 bombs, 2 bombs icons and 10 bombs.

Thanks, i hope i explained it well.
__________________
Reply With Quote
  #2  
Old 06-20-2010, 12:20 AM
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
Quote:
Originally Posted by qw3rt View Post
Hi

I would liked to script a simple baddy but i have a problem,i'm sure its simple but i can't find a solution

PHP Code:
if (timeout && this.mode==4) {
  
random(0,100);
  if (
i<50lay bombslay bombs;
  if (
i>50lay darts
that's a part of the script its about when the baddy die i would like it lays bombs or arrows.

It works, but the problem is it lay 1 bombs icon and when i take it, it gives me 10 bombs.
Me I would like it lay ,instead of 1bombs icons and 10 bombs, 2 bombs icons and 10 bombs.

Thanks, i hope i explained it well.
I hope this helps

HTML Code:
  if (i<50) { 
    lay bombs; 
    lay bombs; 
  }
You can also lay bombs in a certain area, but you can't change the amount you receive

HTML Code:
  lay2 bombs, x, y + 2;
Will lay bombs 2 tiles down from the baddy

(GS2 Converted- will only work online)
HTML Code:
lay("bombs");
lay2("bombs", this.x, this.y + 2);
__________________
Reply With Quote
  #3  
Old 06-20-2010, 12:27 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by xAndrewx View Post
I hope this helps

HTML Code:
  if (i<50) { 
    lay bombs; 
    lay bombs; 
  }
You can also lay bombs in a certain area, but you can't change the amount you receive

HTML Code:
  lay2 bombs, x, y + 2;
Will lay bombs 2 tiles down from the baddy

(GS2 Converted- will only work online)
HTML Code:
lay("bombs");
lay2("bombs", this.x, this.y + 2);
I think he wants to make it so you pick up 5 bombs instead of 10 bombs.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #4  
Old 06-20-2010, 12:31 AM
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
Quote:
Originally Posted by Switch View Post
I think he wants to make it so you pick up 5 bombs instead of 10 bombs.
laybombs produces five bombs.
__________________
Reply With Quote
  #5  
Old 06-20-2010, 12:45 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by xAndrewx View Post
laybombs produces five bombs.
Oh, I see what happened.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #6  
Old 06-20-2010, 12:50 AM
qw3rt qw3rt is offline
qW£rt Classic Iphone
qw3rt's Avatar
Join Date: Jun 2010
Location: France
Posts: 34
qw3rt is an unknown quantity at this point
Quote:
HTML Code:
  lay2 bombs, x, y + 2;
Will lay bombs 2 tiles down from the baddy

(GS2 Converted- will only work online)
HTML Code:
lay("bombs");
lay2("bombs", this.x, this.y + 2);
Yep thanks

i used like this and it works :

PHP Code:
 if (i<50)
    
lay2 bombs,x,y+2;lay2 bombs,x,y
In fact it gaves me 2 bombs icons but it messed cause the secand icons was hidden by the first one, due to the same lay position.

thanks
__________________
Reply With Quote
  #7  
Old 06-20-2010, 03:57 PM
Riot Riot is offline
Delteria Management
Join Date: Nov 2003
Location: Seminole County, Florida
Posts: 280
Riot is on a distinguished road
Quote:
Originally Posted by qw3rt View Post
Yep thanks

i used like this and it works :

PHP Code:
 if (i<50)
    
lay2 bombs,x,y+2;lay2 bombs,x,y
In fact it gaves me 2 bombs icons but it messed cause the secand icons was hidden by the first one, due to the same lay position.

thanks
Note that this probably doesn't work like you want.

Your code currently reads like:
PHP Code:
if (50) {
    
lay2 bombs,x,y+2;
}
lay2 bombs,x,y
The second statement, lay2 bombs,x,y;, will always be executed in this situation.
If statements without brackets will only work for the next statement.

What you want is something like:
PHP Code:
if (50) {
  
lay2 bombs,x,y+2;
  
lay2 bombs,x,y;

Reply With Quote
  #8  
Old 06-20-2010, 06:24 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
Also:

PHP Code:
if (50) {
  
lay2 bombs,x-random(-2,2),y-random(-2,2);
  
lay2 bombs,x-random(-2,2),y-random(-2,2);

Will take care of the problem of everything stacking in the same place.
Reply With Quote
  #9  
Old 06-20-2010, 07:50 PM
qw3rt qw3rt is offline
qW£rt Classic Iphone
qw3rt's Avatar
Join Date: Jun 2010
Location: France
Posts: 34
qw3rt is an unknown quantity at this point
Quote:
Originally Posted by Riot View Post
Note that this probably doesn't work like you want.

Your code currently reads like:
PHP Code:
if (50) {
    
lay2 bombs,x,y+2;
}
lay2 bombs,x,y
The second statement, lay2 bombs,x,y;, will always be executed in this situation.
If statements without brackets will only work for the next statement.

What you want is something like:
PHP Code:
if (50) {
  
lay2 bombs,x,y+2;
  
lay2 bombs,x,y;

it worked but yea at one moment there were always the same things laid i forgot to close the if } thanks

Quote:
Originally Posted by DustyPorViva View Post
Also:

PHP Code:
if (50) {
  
lay2 bombs,x-random(-2,2),y-random(-2,2);
  
lay2 bombs,x-random(-2,2),y-random(-2,2);

Will take care of the problem of everything stacking in the same place.
that what i did i found it on the commands.pdf cause it was boring to manually enter the position thanks for the help.
__________________
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 07:03 PM.


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