edited 1×, last 04.12.09 12:44:11 am
Forum
Scripts
Scripting Questionsmaybe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
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
Admin/mod comment
Please, use normal english /TheKilledDeath Vibhor has written
use dialog boxes?
yes...
in a page that you can choose a song
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
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
freestored "unit",1,WINEID,1;
find 228;
Code so far:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;
}
}
and find with store (228,"$pclass",$pid);
edited 1×, last 08.12.09 09:43:34 pm
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
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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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
$pclass=parent_class;
should be
$pid=parent_id();
$pclass=parent_class();
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.
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?
Scripting Questions


Offline
Re: Scripting Questions