Forum

> > Stranded II > Scripts > Clay bottle firing script(figured it out!)
Forums overviewStranded II overview Scripts overviewLog in to reply

English Clay bottle firing script(figured it out!)

4 replies
To the start Previous 1 Next To the start

old Clay bottle firing script(figured it out!)

Twilight77
User Off Offline

Quote
Never mind, I figured it out.


I'm having trouble with my script. I'm trying to make it so I have a random chance of the bottle breaking but I can't get it to work.
I had it working without the random chance of breakage.
Can someone please help, thanks, Twilight

### Clay Bottle
id=301
name=Clay Bottle
group=stuff
icon=gfx\claybottle.bmp
model=gfx\bottle.b3d
scale=0.8
mat=stone
weight=50
info=A Clay Bottle, It cannot be used until I fire it.
script=start
     //Fire
     on:use {
          if ((count_inrange("state",5,50)+count_inrange("state",4,50))>0){
                    if (random(1,3)=1);{
                         process "Firing",2000;
                         play "crack2.wav";
                         freestored "unit",1,301,1;
                         msg "Oh, no! My bottle broke in the fire!",6;
                    }else{
                         process "Firing",2000;
                         freestored "unit",1,301,1;
                         $id=create("item",106,0,0,1);
                         store $id,"unit",1;
          }}else{
               msg "I need to fire this in the fire!",6;
               speech "negative";
          }
     }
script=end
edited 1×, last 24.06.12 08:26:14 am

old Re: Clay bottle firing script(figured it out!)

Assassin moder
User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
### Clay Bottle
 id=301
 name=Clay Bottle
 group=stuff
 icon=gfx\claybottle.bmp
 model=gfx\bottle.b3d
 scale=0.8
 mat=stone
 weight=50
 info=A Clay Bottle, It cannot be used until I fire it.
 script=start
	//Fire
	on:use {
		if ((count_inrange("state",5,50)+count_inrange("state",4,50))>0){
			if (random(1,3)=1);{
				process "Firing",2000;
				play "crack2.wav";
				freestored "unit",1,301,1;
				msg "Oh, no! My bottle broke in the fire!",6;
			}else{
				process "Firing",2000;
				freestored "unit",1,301,1;
				$id=create("item",106,0,0,1);
				store $id,"unit",1;
		}else{
			msg "I need to fire this in the fire!",6;
			speech "negative";
		}
	}
script=end

Try that

old Re: Clay bottle firing script(figured it out!)

Twilight77
User Off Offline

Quote
I figured it out late last night.

I wouldn't change it to throw because the process of making the bottle is done already and this is the firing process.

This is what worked.

### Clay Bottle
id=301
name=Clay Bottle
group=stuff
icon=gfx\claybottle.bmp
model=gfx\bottle.b3d
scale=0.8
mat=stone
weight=50
info=A Clay Bottle, It cannot be used until I fire it.
script=start
     //Fire
     on:use {
          if ((count_inrange("state",5,50)+count_inrange("state",4,50))>0){
                    process "Firing",2000;
                    freestored "unit",1,301,1;
                    if (random(1,3)==1){
                         play "crack2.wav";
                         msg "Oh, no! My bottle broke in the fire!",3;
                         skipevent;
                         
                    }else{
                         local $id;
                         $id=create("item",106,0,0,1);
                         store $id,"unit",1;
                         skipevent;
                    }
          }else{
               msg "I need to fire this in the fire!",3;
               speech "negative";
          }
     }
script=end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview