Forum

> > Stranded II > Scripts > Scripting Questions
ForenübersichtStranded II-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Scripting Questions

2.429 Antworten
Seite
Zum Anfang Vorherige 1 280 81 82121 122 Nächste Zum Anfang

alt Re: Scripting Questions

Spicy Night Owl
User Off Offline

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

alt Re: Scripting Questions

Spicy Night Owl
User Off Offline

Zitieren
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

alt Re: Scripting Questions

bezmolvie
User Off Offline

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

alt Re: Scripting Questions

amstel bier9
User Off Offline

Zitieren
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

alt Re: Scripting Questions

FalseID
User Off Offline

Zitieren
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

alt Re: Scripting Questions

bezmolvie
User Off Offline

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

alt Re: Scripting Questions

FalseID
User Off Offline

Zitieren
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;
} 
}

alt Re: Scripting Questions

bezmolvie
User Off Offline

Zitieren
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);
1× editiert, zuletzt 08.12.09 22:43:34

alt Re: Scripting Questions

FalseID
User Off Offline

Zitieren
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

alt Re: Scripting Questions

bezmolvie
User Off Offline

Zitieren
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

alt Re: Scripting Questions

FalseID
User Off Offline

Zitieren
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

alt Re: Scripting Questions

bezmolvie
User Off Offline

Zitieren
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();

alt Re: Scripting Questions

FalseID
User Off Offline

Zitieren
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)

alt Re: Scripting Questions

bezmolvie
User Off Offline

Zitieren
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.

alt Re: Scripting Questions

Qtw
User Off Offline

Zitieren
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?
Zum Anfang Vorherige 1 280 81 82121 122 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtStranded II-ÜbersichtForenübersicht