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 232 33 34121 122 Nächste Zum Anfang

alt Re: Scripting Questions

MrCowThing
User Off Offline

Zitieren
Raven Shadow hat geschrieben
Using attack2 would give much greater control over
what is found and how much.

That code was just for one tool in the Swiss Army Knife, you still used right click to switch tools and to switch what you get more of.

EDIT:
Ok, I've gotten the shield working now. I added
1
on:ai_attack{event "player_hurt","global";}
to all the units that hurt you, then used on:player_hurt for the shield.
1× editiert, zuletzt 15.06.08 17:29:43

alt Re: Scripting Questions

bezmolvie
User Off Offline

Zitieren
Question: This dosn't work. Why? I've tried everything
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
script=start
	on:use {
		if ($Helmet()==0) {
			maxhealth "unit",1[,15];
			$Helmet+=1;
		}else{
			msg "I already have a helmet on!";
			skipevent;
		}
	}
	on:drop {
		if ($Helmet()==1) {$Helmet-=1;}
			
	}
script=end

alt Re: Scripting Questions

dragoana
User Off Offline

Zitieren
you should remove some brackets:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
script=start 
	on:use { 
		if ($Helmet==0) { 
			maxhealth "unit",1,15; 
			$Helmet+=1; 
		}else{ 
			msg "I already have a helmet on!"; 
			skipevent; 
		} 
	} 
	on:drop { 
		if ($Helmet==1) {$Helmet-=1;} 
                
	} 
script=end

alt Re: Scripting Questions

Builder2-0
User Off Offline

Zitieren
EDIT: Nvm.

Someone needs to fix the English scripting commands page. Or we need to make it a wiki. The German page has A LOT more explanation to it, and even when translated into bad English by Google translater it is still a thousand times more helpful.

-Builder
1× editiert, zuletzt 23.06.08 00:44:22

alt Re: Scripting Questions

bezmolvie
User Off Offline

Zitieren
Is there anyway to stop the player from saving?
And how do you change islands while keeping the player's items?

alt Re: Scripting Questions

ESKARN
User Off Offline

Zitieren
DC hat geschrieben
loadmap "Map" [,Skills][,Items][,Variables][,Diary][,States][,Buildlocks]

replace everything you want to keep with a 1 and everything you don't want to keep with a 0. you can omit everything after your last 1 since its automatically 0 if you do not enter it. the "[" and "]" just show that the embraced parameter can be omitted so do not write these brackets in your code!

keeping just the items would be this code:
1
loadmap "yourmap",0,1;
or (it's the same):
1
loadmap "yourmap",0,1,0,0,0,0;

Zitat
and is there anyway you can build something on a map and go to a different map then come back and it still be there

yes. thats possible but not very easy. you have to save each map somewhere with s2 cmd savemap (which has the same parameters like loadmap) before you load the next one. when going back to this map you load the map you saved. you might also use s2 cmd loadmaptakeover right after loading a map. its 1 if you got stuff from the previous map (map loaded with loadmap and at least one parameter 1) and 0 if not.





thats the way to keep player items

eg

on:use {
savemap "maps\my maps\savemaps\prison2.s2",1,1,1,1,1,1;
loadmap "maps\my maps\savemaps\thedocs.s2",1,1,1,1,1,1;


on:use {
savemap "maps\my maps\savemaps\thedocs.s2",1,1,1,1,1,1;
loadmap "maps\my maps\savemaps\prison2.s2",1,1,1,1,1,1;
1× editiert, zuletzt 30.06.08 08:15:42

alt Re: Scripting Questions

DC
Admin Off Offline

Zitieren
you do not understand the sense of loadmaptakeover! loadmaptakeover just returns a value. thats all it does! it returns 1 if the current map has been loaded with loadmap and stuff like items or vars or whatever of the last map has been transported to the new map. if nothing from the previous map has been transported to the new map it will return 0.

so writing a script like
1
loadmaptakeover;
makes NO sense. the command does nothing in this script. you just use it to get the return value and to do something with this value. for example:
1
2
3
if (loadmaptakeover()==1){
	msg "there's stuff from the previous map!";
}

alt Re: Scripting Questions

garfield751
User Off Offline

Zitieren
@brandon
Try the fresh water thing in the info section and remember to set a radius

Anyways... does anyone know the script to make something stand still when X happens?

alt Iron Eagle

Gast

Zitieren
Is it possiple to make aircraft turn more realisticly other than just turning on a flat radius please post a script for air craft behaviour if some geniouse can thanks i am planning on makeing a Captain Cook Mod On his travels to the Pacific

alt Re: Scripting Questions

NP_Beta
COMMUNITY BANNED Off Offline

Zitieren
garfield751 hat geschrieben
Anyways... does anyone know the script to make something stand still when X happens?


yes, its possible

1
2
3
4
on:use
{
freeze [1] [1];
}

the first parameter is for the unit id.in our case its the id of the player (set 0 you will freeze all units) the second isn't important for you

alt Re: Scripting Questions

Builder2-0
User Off Offline

Zitieren
The key to reading broken English is to understand the logic behind the sillyness. In this case there was none and I was just as baffled as you. However, I managed to decipher it (I think). I'm sure DC or someone else will correct me if I'm wrong though, so here goes nothing...

selectplace is the command for replicating the "build" view. To use it you do like so:

selectplace "text",height

Text is what appears for the player, ie; "Build", or whatever. Height is the camera's height above the ground. So, you use selectplace along with selectplace_x\y\z to detect where the player is clicking, and therefore you can use it to do things OTHER than building.

You could for example use it to allow the player a way to setup smoke signals. Or other cool shit. Which I am already thinking of ways to use in Massive Mod.

-Builder
Zum Anfang Vorherige 1 232 33 34121 122 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtStranded II-ÜbersichtForenübersicht