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 247 48 49121 122 Next To the start

old Re: Scripting Questions

jockmo42
User Off Offline

Quote
What does the waterpipe do? I thought it would fill with water in the rain, but it doesn't. I set a map to always rain and tested. I'm not sure if it didn't fill because the map started out raining and it missed a trigger or what. It has a behavior in the ini files, but what is it for?
edited 1×, last 21.09.08 12:27:38 am

old Re: Scripting Questions

HudaJan
Super User Off Offline

Quote
Well.
As you can notice the emty pipe and full pipe models are almost the same...
So you could make that it fills in the rain (hint: You can look the script up at water rock full/empty )

old Re: Scripting Questions

jockmo42
User Off Offline

Quote
HudaJan has written
Well.
As you can notice the emty pipe and full pipe models are almost the same...
So you could make that it fills in the rain (hint: You can look the script up at water rock full/empty )


Well, of course one could do this, but I just was wondering if the waterpipe did it already before I messed with it.

old Re: Scripting Questions

Amritsar
User Off Offline

Quote
If your referring to the one from Massive Mod (you are right?)

Then yes it does, I've used it before and seen it do so. I'm pretty sure it only triggers when the rain starts though.

I do have my own question though.

Is it possible to detect what sought of texture the player is standing on? Like could I tell if they are standing on sand as opposed to grass?

old Re: Scripting Questions

jockmo42
User Off Offline

Quote
Amritsar has written
If your referring to the one from Massive Mod (you are right?)


I don't use Massive Mod. I'm referring to the regular one. What does its behavior mean?

old Re: Scripting Questions

Amritsar
User Off Offline

Quote
I really must of been out of circulation of the Stranded community for a while...

I don't remember a water pipe?

Maybe it was from the original that I was talking about anyway...

Is what we're discussing a long hollowed out log help up with branches/poles whatever?

old Re: Scripting Questions

jockmo42
User Off Offline

Quote
Amritsar has written
I really must of been out of circulation of the Stranded community for a while...

I don't remember a water pipe?

Maybe it was from the original that I was talking about anyway...

Is what we're discussing a long hollowed out log help up with branches/poles whatever?


Yes. It's an object from the original stranded, it just can't be built. It doesn't matter, I already figured it out. Thanks anyway.

New problem. What's wrong in here? I'm trying to add a light state, and then remove it after a timer. When tested, the state is added, the eating happens, the bottle is created, but it freaks over the timer saying it expected a semicolon. I've never used timers, what did I do wrong?

     on:eat {
          process "eating",3000;
          eat 0,15,3,0;
          local $id;
               $id=create("item",106);
               store $id,"unit",1;
          addstate "unit",1,"light";
          statevalue "unit",1,"light",5;
          timer 0,8000,1,freestate "unit",1,"light";
     }

I think I'm supposed to have some tmp's and =='s in there, but I don't know where to start.
edited 2×, last 22.09.08 03:03:05 am

old Re: Scripting Questions

GreyMario
User Off Offline

Quote
on:eat {
          process "eating",3000;
          eat 0,15,3,0;
          local $id;
               $id=create("item",106);
               store $id,"unit",1;
          addstate "unit",1,"light";
          statevalue "unit",1,"light",5;
          timer 0,8000,1,freestate("unit",1,"light");
     }

Try that, that might be the issue. <_<

old Re: Scripting Questions

jockmo42
User Off Offline

Quote
GreyMario has written
on:eat {
          process "eating",3000;
          eat 0,15,3,0;
          local $id;
               $id=create("item",106);
               store $id,"unit",1;
          addstate "unit",1,"light";
          statevalue "unit",1,"light",5;
          timer 0,8000,1,freestate("unit",1,"light");
     }

Try that, that might be the issue. <_<


No dice.

old Re: Scripting Questions

humer
User Off Offline

Quote
Yes, because the last row isn't correct, try this instead

1
2
3
4
5
6
7
....
timer 0,8000,1,"timer";
}

on:timer {
	freestate"unit",1,"light";
}

old Re: Scripting Questions

ESKARN
User Off Offline

Quote
is there anyway to make a raptor (or any unit) attack another unit
eg raptor attack a monkey

can you change the color of the water for only one map?
edited 2×, last 22.09.08 12:37:58 pm

old Re: Scripting Questions

jockmo42
User Off Offline

Quote
humer has written
Yes, because the last row isn't correct, try this instead

1
2
3
4
5
6
7
....
timer 0,8000,1,"timer";
}

on:timer {
	freestate"unit",1,"light";
}


Awesome, man, thanks a lot.

DontKnowToScript has written
1
2
3
if (gety("unit",1)<0){
addstate "unit",1,"wet";
}
add this to game.inf and see that you get wet state.


Didn't work for me. Said unit with ID 1 doesn't exist.

I'm not sure if it has to do with where I put it, but it only makes me wet when I try to sleep in the water.
edited 2×, last 22.09.08 11:52:16 pm

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
Because when you sleep, it registers how high you are. set a timer for a half a second or so, and then order it to check the players height

old Re: Scripting Questions

jockmo42
User Off Offline

Quote
Bloodshot has written
Because when you sleep, it registers how high you are. set a timer for a half a second or so, and then order it to check the players height


Would that be expensive system-wise?

EDIT: Nevermind. Got a loop working and it's smooth as silk.

DontKnowToScript has written
about changing the water color,use s2 cmd watertexture
and write a path to an image file (eg:water_dark)


Where would I do this? Like, which file do I use it in?

I also have a problem with my campfire. I'm trying to make it dry the player off instead of only removing frostbite.
1
2
3
4
5
6
7
8
9
10
on:use {
		if (gotstate("unit",1,6))or(gotstate("unit",1,11)){
			if ((gotstate("self",4)+gotstate("self",5))>0){
				process "warming up",3000;
				freestate "unit",1,6;
				freestate "unit",1,11;
		}else{
			msgbox "Campfire","sys/scripts/fireplace.s2s";
		}
	}
It tells me it's expecting a { on row 5.
edited 3×, last 23.09.08 01:17:54 am

old Re: Scripting Questions

DC
Admin Off Offline

Quote
add some brackets. the whole if-condition has to be bracketed. "or" was not bracketed in your script.
1
if [b]([/b](gotstate("unit",1,6))or(gotstate("unit",1,11))[b])[/b]{

and you forgot an "}". you have 4 "{" but only 3 "}". this can't work.

old Re: Scripting Questions

jockmo42
User Off Offline

Quote
DC has written
add some brackets. the whole if-condition has to be bracketed. "or" was not bracketed in your script.
1
if [b]([/b](gotstate("unit",1,6))or(gotstate("unit",1,11))[b])[/b]{

and you forgot an "}". you have 4 "{" but only 3 "}".this can't work of.


Sweet, thanks man.

EDIT: Oh, the other "}", thanks, haha. Fixed everything.
To the start Previous 1 247 48 49121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview