Forum

> > Stranded II > Scripts > food poisoning script (rather simple)
ForenübersichtStranded II-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch food poisoning script (rather simple)

9 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt food poisoning script (rather simple)

aimeewilbury
User Off Offline

Zitieren
I always thought it weird in Stranded II that if you ate raw meat there was no chance of getting sick. So I modified the large meat a bit. It'll give you a 1/4 (I think) chance of getting food poisoning, where you lose 60 health, vomit, and get the fuddle & dizzy states. I tested it and it works fine on my end. Enjoy.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//Eat
	on:eat {
		$event=random(0,3);
		if ($event==1) {
 		process "Vomiting",1000;
		eat -60,0,0,15;
		addstate "unit",1,"fuddle";
		statevalue "unit",1,"fuddle",10;
		addstate "unit",1,"dizzy";
		statevalue "unit",1,"dizzy",10;
		play "vomit.wav";
		vomit 1;
	}else{
		process "eating",1000;
		eat 5,20,10,0;}
	}

alt Re: food poisoning script (rather simple)

Hurri04
Super User Off Offline

Zitieren
I thinks there is an error in this scripts which makes me doubt that it really works fine:

there has to be another line with a closing bracket (}) after the vomit command. also, for syntax purposes (better reading, easier seeing errors) the lines from "process "Vomiting",1000;" to "vomit 1;" have to be tabbed to the right one more time.

further, a little tip: you dont always need to use variables to save values which are returned by commands, you can instead put the command into the place of the variable directly in cases like these, where you need a certain value for just one time.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//Eat
	on:eat {
		if (random(0,3)==1) {
			process "Vomiting",1000;
			eat -60,0,0,15;
			addstate "unit",1,"fuddle";
			statevalue "unit",1,"fuddle",10;
			addstate "unit",1,"dizzy";
			statevalue "unit",1,"dizzy",10;
			play "vomit.wav";
			vomit 1;
		}else{
			process "eating",1000;
			eat 5,20,10,0;
		}
	}
Edit: corrected my script, see below.
2× editiert, zuletzt 31.07.11 13:51:47

alt Re: food poisoning script (rather simple)

aimeewilbury
User Off Offline

Zitieren
Actually, look closely and the bracket is before the "else". I dont know how it ended up there when I pasted it but it looks OK in the text editor.

But I did the tab thing and fixed the variable

alt Re: food poisoning script (rather simple)

Hurri04
Super User Off Offline

Zitieren
oh, then I "corrected" it wrong, the bracket has to be at a different place then, but still, I was right when saying that it was missing.

look at your script, there are 3 opening brackets ({) but only 2 closing brackets (}).

I'm gonna correct my script above real quick

alt Re: food poisoning script (rather simple)

HudaJan
Super User Off Offline

Zitieren
I'm sorry Hurry, but his script is correct. He has 3 opening and 3 closing brackets. Look closely. The "else" one is a bit confusing.
To aimee: this is good idea indeed, as I said, your script is correct. I would add only one thing, namely some timer which removes a dizziness after some time, otherwise it could ruin a gameplay a little.
But keep up the good work

alt Re: food poisoning script (rather simple)

Hurri04
Super User Off Offline

Zitieren
argh, damn it.

didnt see the closing bracket at the end

well, I guess that's what you get when trying to do scripting late in the night lol.

Mehr >

alt Re: food poisoning script (rather simple)

aimeewilbury
User Off Offline

Zitieren
user HudaJan hat geschrieben
To aimee: this is good idea indeed, as I said, your script is correct. I would add only one thing, namely some timer which removes a dizziness after some time, otherwise it could ruin a gameplay a little.


Well I noticed if you go to sleep the states will go away. So it makes sense to me

By the way, I'm a she! My name is a badly misspelled version of "Amy"
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtStranded II-ÜbersichtForenübersicht