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 236 37 38121 122 Nächste Zum Anfang

alt Re: Scripting Questions

HudaJan
Super User Off Offline

Zitieren
Mc Leaf, again.. Who else
Thanks again, maybe you should create some hot link and receive money

alt Re: Scripting Questions

lenz-_-
User Off Offline

Zitieren
1. How do i add particles to an object?
2.How do i set arcade mode on a map? ( not sure if this is scripting xD)

alt Re: Scripting Questions

HudaJan
Super User Off Offline

Zitieren
If you want to add particle state in editor already, simply select the object and press ''+'' at "state". Then select the state and pres + again.
2. See infos in the editor. It's somwhere down and it is called "Arcade mod"

alt Re: Scripting Questions

Gast

Zitieren
Guest hat geschrieben
hey how do i make new skills

hey and how do i make units stay in their place like in last mission i adventure at village like the cheiftain

alt Re: Scripting Questions

lenz-_-
User Off Offline

Zitieren
And i got one more, i just facken started learning and i am already pissed off, what seems to be the error in this simple code?
1
2
3
4
5
on:collect {
local $collects
$collects=++;
msg " Until now, you collected $collects of this type";
}
1× editiert, zuletzt 18.08.08 22:03:36

alt Re: Scripting Questions

HudaJan
Super User Off Offline

Zitieren
Guest hat geschrieben
hey and how do i make units stay in their place like in last mission i adventure at village like the cheiftain

on:start {
     ai_stay "self",1;
     }
LenZ:
If you want learn scripting, you should make it different way. thi put for example this code to ANY object
on:use {
     $uses++;
     msg "I've used this object for $uses times";
     }
And if you really want to know count of collected item, try this:
Put some info (flag for example) to game and remember ID, we say 2 (global scripts)
on:start {
     def_extend "item",Typ,2; //type is id of item. e.g. crystal has 1, branch 24 atd. see items.inf
}

and to our flag:

on:collect {
     $collects++;
     msg "I've collected $collects items of that type";
}

alt Re: Scripting Questions

Raven Shadow
User Off Offline

Zitieren
LenZ hat geschrieben
And i got one more, i just facken started learning and i am already pissed off, what seems to be the error in this simple code?
1
2
3
4
5
on:collect {
local $collects
$collects=++;
msg " Until now, you collected $collects of this type";
}

well every time the collect event fires, the variable
$collects is reset to zero.
Other then that, you need to tell use what it IS doing
so we have an idea of what errors you're talking
about.

alt Re: Scripting Questions

bezmolvie
User Off Offline

Zitieren
jon hat geschrieben
i am making a advernure mod wee you are straned on a island that used to have a farming town on it and i want to make it so that you can only plant in the farm and not any were eals.

1
2
3
4
5
6
7
script=start
	on:useground {
		if (inrange "unit", 1 [,this depends on how big the farm is- use fence pieces and tell me the dimensions] [,"object", put a small object in the center of ur farm- then put it's id here]=0) {
		skipevent;
		}
	}
script=end
put this in ur map's script. send me the map and i'll send it back with the scripting if u want

alt how do you make a grape vine tupe plant

darksol
User Off Offline

Zitieren
i am wondering how to make a plant like a grape vine were the stuff is on the vine and you don't have to destroy the plant to get it i have milkshape but i don't no how to make one

alt Re: Scripting Questions

DontKnowToScript
User Off Offline

Zitieren
HudaJan hat geschrieben
Guest hat geschrieben
hey and how do i make units stay in their place like in last mission i adventure at village like the cheiftain

on:start {
     ai_stay "self",1;
     }
LenZ:
If you want learn scripting, you should make it different way. thi put for example this code to ANY object
on:use {
     $uses++;
     msg "I've used this object for $uses times";
     }
And if you really want to know count of collected item, try this:
Put some info (flag for example) to game and remember ID, we say 2 (global scripts)
on:start {
     def_extend "item",Typ,2; //type is id of item. e.g. crystal has 1, branch 24 atd. see items.inf
}

and to our flag:

on:collect {
     $collects++;
     msg "I've collected $collects items of that type";
}

and how do i make skills
p.s i got the idea of the ai to stay in his place
i registered

alt Re: Scripting Questions

bezmolvie
User Off Offline

Zitieren
darksol- put grapes in ur hand, close the rucksack, look at the ground and press use (e by default) and a little grape vine should pop up.

alt Re: Scripting Questions

HudaJan
Super User Off Offline

Zitieren
The new skill si rather difficult for newbie scripter, sorry
But if you really want, try to examine some of the actual skills. See game.inf (at the bottom of the file)

alt grape vine thing

darksol
User Off Offline

Zitieren
i no how to plant i am just not shoure how to make a plant like a grape vine i want to make a corn plant i am just wondering how to make the corn grow on the vine?

alt Re: Scripting Questions

DontKnowToScript
User Off Offline

Zitieren
darksol hat geschrieben
i no how to plant i am just not shoure how to make a plant like a grape vine i want to make a corn plant i am just wondering how to make the corn grow on the vine?

copy the grape vine text in the game files then create corn item then change the first spawn number to the corn id.

alt Re: Scripting Questions

DontKnowToScript
User Off Offline

Zitieren
Eagle hat geschrieben
Hi guys,
I need a bit of help. I am new to the idea of scripting and don't quite understand what is going on. I am trying to put a cooking skill into the game, but I am having trouble with setting up a certain script. I am trying to set it up so you can only cook cookies with a certain cooking skill with little luck
This is the script I have below:

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
script=start
	//Bake!
	on:use {
		if (skillvalue("cooking")>=450){
		if ((count_inrange("state",5,50)+count_inrange("state",4,50))>0){
			fry;
			process "baking",1000;
			alteritem 1,66,10;
				event "iskill_cooking","global";
		}else{
			msg "I need fire to bake this!",3;
			speech "negative";
		}
	}
	}else{
	speech "negative";
	msg "I cannot do this yet!",3;
	msg "My cooking skill needs to be higher!",3;
	}
	//Eat
	on:eat {
		process "eating",1000;
		eat 7,50,5,0;	
	}
script=end

However it doesn't seem to work. In debug mode it says:

1
2
3
4
5
6
7
SCRIPT ERROR:
"else" or "elseif" without matching "if"
Script: Item 4454 (Chocolate Dough type 115 )
Event: use
Row: 14
Col: 6
Script: }else{

Would someone be able to correct what I have done wrong and post the correct script for me. I would be grateful for all your help.

me too. i can do it but i need help on creating the skill itself

alt Re: Scripting Questions

Raven Shadow
User Off Offline

Zitieren
darksol hat geschrieben
i no how to plant i am just not shoure how to make a plant like a grape vine i want to make a corn plant i am just wondering how to make the corn grow on the vine?


To have crops requires 2 models, the plant and the fruit.
Take a look at how the grapevine is defined, you'll see
that is uses the s2 cmd spawn command.
That command tells the game to grow fruit on the plant
The format for the command is:
1
spawn = item ID [, Growing Number of days] [, X-radius] [, Z-radius] [, Y offset] [max amount] [, number per group]

item ID is the ID used to define the fruit in the
item_xxx.inf file.

X-radius and Z-radius determines how out from the
center point of the plant's model the fruit will grow from.

max amount tells the game the maximum amount
of friut that should be on the plant before it waits for
you to pick it.

number per group controls how many fruit you get
when you pick 1. For example, when you pick 1 grape
from the vine, 10 will be put in your inventory.
1× editiert, zuletzt 20.08.08 22:15:37
Zum Anfang Vorherige 1 236 37 38121 122 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtStranded II-ÜbersichtForenübersicht