Forum

> > Stranded II > Scripts > Scripting Questions
Forums overviewStranded II overview Scripts overviewLog in to reply

English Scripting Questions

2,429 replies
Page
To the start Previous 1 280 81 82121 122 Next To the start

old Re: Scripting Questions

Spicy Night Owl
User Off Offline

Quote
how to make a box where the player can type wut he wants and it will be written on the piece of paper?
edited 1×, last 04.12.09 01:44:11 am

old Re: Scripting Questions

Spicy Night Owl
User Off Offline

Quote
how can i open a menu in the scripts, this is part of my mod, such as

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
### Papyrus Paper
id=227
name=Papyrus Paper
group=material
icon=gfx\paper.bmp
model=gfx\paper.b3d
scale=0.35
mat=leaf
weight=2
info
info=papyrus paper
script=start
                 on:use {
                                    menu here
script=end

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
use dialogue "Start","PATH"; Where path is a notepad file with the dialog script (Note i did Not spell Dialogue wrong)

old Re: Scripting Questions

amstel bier9
User Off Offline

Quote
hi...

i've mad an Ipod touch model..
and now i try to make a script where you can choose be ytour self whats music you want...
can anybody tell me the script for that?

already thanks

old Re: Scripting Questions

FalseID
User Off Offline

Quote
Can you help me with this code please? I am trying add brewing but i can't get it right. I want the grape juice to turn into wine after 7 days but it just doesn't work.
Debug says that there was an error in the script but i couldn't figure it out.
Here's the code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
script=start 
on:create { 
	$age=1; 
	} 
	on:use { 
		msg "Aged for $age days",3; 
	} 
	on:eat { 
	          process "drinking",2000; 
	          drink 10,5,30,0; 
	} 
	on:changeday {
    	      if ($age>=0){ 
   	            $age++; 
   	            if ($age>=7){ 
 	     alteritem "self",228; //debug
           } 
	freevar $age;
} 
} 
script=end

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
You can't have alteritem except on use and combos. Replace it with
freestored "unit",1,WINEID,1;
find 228;

old Re: Scripting Questions

FalseID
User Off Offline

Quote
It works perfectly when kept in inventory but i'd like it to work when it's kept inside a container as well, like storage. When i tested it with containers it puts the wine in my inventory which i don't want (i want it to appear in the container), also it doesn't remove the grape juice from the container.

Code so far:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
on:create { 
	$age=1; 
	} 
	on:use { 
		msg "Aged for $age days",3; 
	} 
	on:eat { 
	          process "drinking",2000; 
	          drink 10,5,30,0; 
	} 
	on:changeday {
    	      if ($age>=0){ 
   	            $age++; 
   	            if ($age>=7){ 
 	     freestored "unit",1,39,1;
		find 228;

           } 
	freevar $age;
} 
}

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
Put local $pid,$pclass,$age; at the beginning, along with $pid=parent_id; $pclass=parent_class; Replace freestored with freestored ("$pclass",$pid,39,1);
and find with store (228,"$pclass",$pid);
edited 1×, last 08.12.09 10:43:34 pm

old Re: Scripting Questions

FalseID
User Off Offline

Quote
Doesn't work. Debug says there's an error in the script.
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
script=start 
on:create { 
	local $pid,$pclass,$age;
	$pid=parent_id; 
	$pclass=parent_class;
	$age=1; 
	} 
	on:use { 
		msg "Aged for $age days",3; 
	} 
	on:eat { 
	          process "drinking",2000; 
	          drink 10,5,30,0; 
	} 
	on:changeday {
    	      if ($age>=0){ 
   	            $age++; 
   	            if ($age>=2){
	freestored ("$pclass",$pid,39,1);
	store (228,"$pclass",$pid);
	} 
	freevar $age,$pid,$pclass;
} 
} 
script=end

old Re: Scripting Questions

bezmolvie
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
script=start 
on:create { 
     local $pid,$pclass,$age; 
     $pid=parent_id; 
     $pclass=parent_class; 
     $age=1; 
     } 
     on:use { 
          msg "Aged for $age days",3; 
     } 
     on:eat { 
      process "drinking",2000; 
      drink 10,5,30,0; 
     } 
     on:changeday { 
      if ($age>=0){ 
      $age++; 
      }elseif ($age>=2){ 
     freestored ("$pclass",$pid,39,1); 
     store (228,"$pclass",$pid); 
     } 
     freevar $age,$pid,$pclass; 
} 
script=end
Try that instead. You messed up the if's

old Re: Scripting Questions

FalseID
User Off Offline

Quote
Tried that. There was no error report this time but it still doesn't work. $age turns to 0 and doesn't change anymore, when i tested it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
script=start 
	on:create {
	local $pid,$pclass,$age;
	$pid=parent_id;
	$pclass=parent_class;
	$age=1;
	}
	on:use {
	msg "Aged for $age days",3;
	}
	on:eat {
	process "drinking",2000;
	drink 10,5,30,0;
	}
	on:changeday {
	if ($age>=0){
	$age++;
	}elseif ($age>=2){
	freestored ("$pclass",$pid,39,1);
	store (228,"$pclass",$pid);
	}
freevar $age,$pid,$pclass; 
} 
script=end

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
I'm not sure. I did spot one of my mistakes, $pid=parent_id;
$pclass=parent_class;
should be
$pid=parent_id();
$pclass=parent_class();

old Re: Scripting Questions

FalseID
User Off Offline

Quote
Didn't work. When i check its age ingame it just turns to 0 once 2 days are over. (Changed it to 2 days to make testing easier)

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
Yeah, it should, because
1) It is a local variable, only accesible by THAT wine bottle
2) It should dissapeer on the second day, and lose all local vars.

old Re: Scripting Questions

Qtw
User Off Offline

Quote
okay i have quite a few scripting questions.
1 how do i make armor that works in your inventory and you dont have to equip it first?
2 how do you make items that break after a few uses?
3 how do i create new items after eating one. for example i drink water and i get a bottle how do i do that?
4 how do i make combinations that spawn random items each time?
5 how do i make a limit how many of a certain item can go into your inventory?
6 how do i make a item that plants something and will grow over a few days like grain and trees?
To the start Previous 1 280 81 82121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview