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 236 37 38121 122 Next To the start

old Re: Scripting Questions

HudaJan
Super User Off Offline

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

old Re: Scripting Questions

lenz-_-
User Off Offline

Quote
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)

old Re: Scripting Questions

HudaJan
Super User Off Offline

Quote
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"

old Re: Scripting Questions

Guest

Quote
Guest has written
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

old Re: Scripting Questions

lenz-_-
User Off Offline

Quote
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";
}
edited 1×, last 18.08.08 10:03:36 pm

old Re: Scripting Questions

HudaJan
Super User Off Offline

Quote
Guest has written
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";
}

old Re: Scripting Questions

Raven Shadow
User Off Offline

Quote
LenZ has written
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.

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
jon has written
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

old how do you make a grape vine tupe plant

darksol
User Off Offline

Quote
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

old Re: Scripting Questions

DontKnowToScript
User Off Offline

Quote
HudaJan has written
Guest has written
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

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
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.

old Re: Scripting Questions

HudaJan
Super User Off Offline

Quote
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)

old grape vine thing

darksol
User Off Offline

Quote
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?

old Re: Scripting Questions

DontKnowToScript
User Off Offline

Quote
darksol has written
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.

old Re: Scripting Questions

DontKnowToScript
User Off Offline

Quote
Eagle has written
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

old Re: Scripting Questions

Raven Shadow
User Off Offline

Quote
darksol has written
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.
edited 1×, last 20.08.08 10:15:37 pm
To the start Previous 1 236 37 38121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview