Forum

> > Stranded II > Scripts > Searching through item and doesnt dissapear
Forums overviewStranded II overview Scripts overviewLog in to reply

English Searching through item and doesnt dissapear

12 replies
To the start Previous 1 Next To the start

old Searching through item and doesnt dissapear

RazorBlade9
User Off Offline

Quote
Hey I have a coding problem with a script with a lion leg.

I can search it perfectly fine it's just the leg doesn't dissapear after searching 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
22
23
24
25
26
27
28
### Lion Leg
id=122
name=Lion Leg
group=food
icon=gfx\lionleg.bmp
weight=300
info=a massive lion leg
script=start
	on:use {
		process "searching",1500;
		local $id;
		if (random(3)==1){
			play "mat_leaf1.wav";
			speech "positive";
			msg "Small Meat!",4;
			$id=create("item",11);
			store $id,"unit",1;
		}else{
			play "mat_leaf1.wav";
			speech "positive";
			msg "Meat!",4;
			$id=create("item",9);
			store $id,"unit",0;

		}
		freestored "unit",1,102,1;
	}
script=end

old Re: Searching through item and doesnt dissapear

Hurri04
Super 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
### Lion Leg
id=122
name=Lion Leg
group=food
icon=gfx\lionleg.bmp
model=gfx\
weight=300
info=a massive lion leg
script=start
	on:use {
		process "searching",1500;
		if (random(3)==0){
			msg "Small Meat!",4;
			$id=create("item",11);
		}else{
			msg "Meat!",4;
			$id=create("item",9);
		}
		play "mat_leaf1.wav";
		speech "positive";
		store $id,"unit",1;
		freestored "unit",1,122,1;
	}
script=end
fixed a few things:

line 6: model definition was missing. you still need to complete this line by putting the file name and format of the model.

line 12: s2 cmd random creates a value between 0 and 3 in this case so you should also start with 0 instead of 1.

line 19-21: those lines were the same in either way of the if-cases so it's better to just write them once below.

line 22: since this definitions says id=122 in the beginning I fixed this line by replacing the 102 by 122.


also I removed the s2 cmd local line since it isnt really needed here. saves some resources (minimal).

apart from those scripting errors you might want to adjust the weight, 300 grams for one "massive" lion leg seems a little light-weight.
edited 1×, last 21.10.12 12:11:38 am

old Re: Searching through item and doesnt dissapear

RazorBlade9
User Off Offline

Quote
Hey thanks again and any idea why this doesn't work it comes up with 'Invalid item id if(random==3)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
### Kiwi Leg
id=123
name= Kiwi Leg
group=food
icon=gfx\kiwileg.bmp
weight=1500
info=a massive lion leg
script=starton:use {
          process "searching",1500;
          if (random(3)==0){
               msg "Tiny Meat!",4;
               $id=create("item",121);
          }else{
               msg "Small Meat!",4;
               $id=create("item",11);
          }
          play "mat_leaf1.wav";
          speech "positive";
          store $id,"unit",1;
          freestored "unit",1,122,1;
     }
script=end

old Re: Searching through item and doesnt dissapear

Hurri04
Super User Off Offline

Quote
first thing I see is line 8: put the "on:use {" into a new line!

next, line 20: replace 122 by 123.

line 6: better lower that weight.
and line 7: replace the info text. this isnt really that inportant since it isnt scripting related but for the sake of doing it right.

also, (very important!), you forgot the line
1
model=gfx\MODELNAME.FORMAT
again!

old Re: Searching through item and doesnt dissapear

RazorBlade9
User Off Offline

Quote
I am very sorry that I always leave out the model line its just I cannot find a modeller as I cannot model myself; you have been very helpful already and If you can find a modeller or model yourself could you please inform me

Thanks again,
RazorBlade9

old Re: Searching through item and doesnt dissapear

Hurri04
Super User Off Offline

Quote
personally, I am using Milkshape 3d for modelling but it cousts money. sadly I havent done any bigger modelling in almost 2 years now and therefore am pretty much out of practice.

other people around here are using blender, wings 3d or some other programs. better use the search function and look up "3d modelling program" or something here in the forum, as I dont quite remember all of them. all have their pros and cons, some are better for beginners than others and some cost money, so it'd be advisable to check out some of the free ones first and see whether the fit you.

for the time being you can just use some other model(s) as placeholder until you either find someone or learn how to create models by youself. being able to do this usually is a great advantage when creating a modification.

old Re: Searching through item and doesnt dissapear

RazorBlade9
User Off Offline

Quote
Thank you so much and of topic:
Could you possibly translate the Cast Away Mod to english I know that the german stranded II mod community is much more active but I'm sure that many people would appreciate it me included

old Re: Searching through item and doesnt dissapear

Corvallis5
User Off Offline

Quote
user RazorBlade9 has written
Thank you so much and of topic:
Could you possibly translate the Cast Away Mod to english I know that the german stranded II mod community is much more active but I'm sure that many people would appreciate it me included

Actually, the tide seems to have turned and the English forum is much more active now. As of now the English S2 forum has 158 more threads than its German counterpart.

old Re: Searching through item and doesnt dissapear

Hurri04
Super User Off Offline

Quote
@user RazorBlade9: well, I planned on translating my mod but this is a step I only wanted to take once my mod had reached a certain size and amount of features so it would be at least a little playable.
as of now there are still many unfinished things left for me to fix and the german version I already released is also only an pre-playable alpha version.

technically the translation shouldnt be a big problem as I think my english is decent enough. the problem is that I'd have to develope two different versions of my mod from the moment I decide to translate it. having to synchronize two mods is also no walk in the park as already the current version needs some more heavy developement.



@user Corvallis5: yes, I have also noticed that the german S2 section is nearly dead which is actually pretty sad to me since I always had fun helping other people with their scripting problems (as long as they weren't totally idiotic ).

but I wouldnt neccessarily say that it's a sign that there are more threads in the english section because
a) the rest of the world is way bigger than germany, hence there are more people to post things and
b) it might also be a sign that those threads are of lower quality (e.g. kiddies claiming to create new mods of which nothing was ever heard from again 2 weeks later).

old Re: Searching through item and doesnt dissapear

Corvallis5
User Off Offline

Quote
user Hurri04 has written
@user Corvallis5: yes, I have also noticed that the german S2 section is nearly dead which is actually pretty sad to me since I always had fun helping other people with their scripting problems (as long as they weren't totally idiotic ).

but I wouldnt neccessarily say that it's a sign that there are more threads in the english section because
a) the rest of the world is way bigger than germany, hence there are more people to post things and
b) it might also be a sign that those threads are of lower quality (e.g. kiddies claiming to create new mods of which nothing was ever heard from again 2 weeks later).

Yes, I will agree that the German section has much better quality (from what google translator has showed me) but I think that is mainly because of S2's age, and the crowds will come back with the arrival of Stranded III.

old Re: Searching through item and doesnt dissapear

RazorBlade9
User Off Offline

Quote
Wow! I am surprised that the two of you are talking on my forum... I am kind of honored.

Back on topic :
Anyone wanna model a lion leg and kiwi leg you don't need to be skilled you only need to remove the rest of the body of each animal
To the start Previous 1 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview