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 211 12 13121 122 Next To the start

old Re: Scripting Questions

bizzl
User Off Offline

Quote
HudaJan has written
1
2
3
4
5
on:kill {
local $gnp
$gnp=(count_stored("self",120));
msg "$gnp gunpowders in the barrel";
}
And message always reads 0 gunpowders in the barrel, so this might be the problem, but where ?

in this particular case (if you copy'n'pasted the code) the problem is a missing semicolon.

But it's also possible that count_stored doesn't take "self", so you have to build something like this:
1
2
3
4
local $class,$id;
$class=currentclass();
$id=currentid();
$gnp=count_stored($class,$id,120);

old Re: Scripting Questions

HudaJan
Super User Off Offline

Quote
Hmm, I must say: speech "negative"
no realy it's not working...
But when you look for example to sheep you can see:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//Spawn 2xWool at Start
	on:start {
		local $id;
		$id=create("item",48,0,0,2);
		store $id,"self";
		freevar $id;
	}
	//Add 3xWool per Night
	on:changeday {
		if ([b]count_stored("self",48)[/b]<15){
			local $id;
			$id=create("item",48,0,0,3);
			store $id,"self";
			freevar $id;
(I haven't made it up it is in cfg files...)
And it works perfectly so I dont understend... But never mind, I'll do without it... Though I thank you.

old Re: Scripting Questions

HudaJan
Super User Off Offline

Quote
Sorry for bothering you again, but is there some command to repet sound again again(like when you are underwater)? Thx

old Re: Scripting Questions

Brandon
User Off Offline

Quote
This script drives me crazy!

I want to make 15 damage to long range bow.
(This is areal trigger)
Help me with errors.

on:trigger {
damage "item",60,15;
}

(And of course I checked instant active.

old Re: Scripting Questions

bizzl
User Off Offline

Quote
Actually, your Script damages the item with the Mapside ID 60, which can be pretty much anything
You can't override the damage-values that easy, you have to use an on:impact-script which get's loaded into the arrow by s2 cmd def_extend, e.g. :
Textcontainer with ID X contains this:
1
2
3
4
5
6
7
8
on:impact {
	$tmp=impact_class();
	$tmp2=impact_id();
	if (exists($tmp,$tmp2)==1) {
		damage $tmp,$tmp2,15;
	}
	freevar $tmp,$tmp2;
}
Your trigger contains this:
1
2
3
4
on:trigger {
	def_extend "item",60,[i]X[/i];
	stoptrigger currentid();
}

old How do ya' increase the size of flames?

Guest

Quote
Hi all!

I recently downloaded the game, and having beaten the campaign and messed around with some endless maps, I turned to modding... currently, I'm working on a survival skill mod, and all is going well, but for one thing.

Ya' see, I created a new item - bondfire - which is basically a bigger version of the campfire. Everything is fine, but the flame is much too small... anyone know how to increase the size of the flame effects?

Thanks a lot!

Oh, and DC... GREAT game, thanks for the hours of fun in front of my computer!

old Re: Scripting Questions

Flying Lizard
User Off Offline

Quote
DC was to lazzy to implement that you can change the sze of the flame by changing the corresponding value of the state -.-

old Re: Scripting Questions

Guest

Quote
Wait - are you saying that DC was too lazy to implement this and that you CAN'T make the flame bigger, or that you can by changing the state's values?

Oh, and if you can change it, erm, could someone direct me to the states file? I can't seem to find it... Well, to be precise, I found states.inf, but that seems to be just an info file - there are no values to change there, right?

Even after extensively searching through the sys files, I can't find any dealing with the states' values... if someone could help, it'd be greatly appreciated!

Thanks a lot!

old Re: Scripting Questions

Shade
User Off Offline

Quote
Hm... well do you think it's possible to create several fire states for the one fire, to give the illusion of a bigger fire? If so, I'll start working on that. (Or rather - try... I'm a rather novice scripter :P)

old Re: Scripting Questions

Shade
User Off Offline

Quote
Ah, well, I'll have to stick with my lil' fire in my big fireplace then

Thanks for the help guys!

old Re: Scripting Questions

EwokChieftain
User Off Offline

Quote
Perhaps it doesn't look too bad if you just pile up some of the standard flames in the right manner. In old games, they used to do that with explosions, too.

old Re: Scripting Questions

Shade
User Off Offline

Quote
Wait - didn't flyinglizard say that wouldn't work? Hm, which of you to believe... Well, I'll definately try it, but I'm a very novice scripter, and I don't think I'll be able to... my main question is how to put the eternal fire state in several parts of the bonfire?

Thanks a lot!

EDIT:

I have antoher question

Here goes...

I created a jetty object which is supposed to spawn fish... I used the code from the parrot's nest but changed the IDs... it works fine, but all the fish are spawned together, and get stuck on the side of the island... If anyone can help, I'd appreciate it!

SECOND EDIT:

Alright, well, actually, that seemed to be an isolated case, and after more testing, it seems that the fish spawning seems fine... HOWEVER, I jsut realised that having fish doesn't MATTER to fishing; there just needs to be a fishing spot; am I correct? Well, looks like I'm gonna have to try and "spawn" a fishing spot next to the dock... hm...

THIRD EDIT:

Erm, I'm trying to get my dock to make a fishing area when it's created, but I can't seem to find the command... the fishing area info says "Use the script command "inarea_fish" to check if an object is in such an area." But I want to create such an area... is this possible?

OH and I know this is the wrong forum, but just a little translation error here:

"The player will get them if he fishs in this area." The verb is "fishes" not "fishs"
edited 3×, last 27.01.08 07:52:29 pm

Admin/mod comment

No matter how little it is, there's no need not to post it in the translation mistakes thread. I've quoted your report there. /EwokChieftain

old Re: Scripting Questions

Guest

Quote
Hi, I have a few questions:

- Is it possible to make the things from random maps to spawn with random rotation/set rotation?

- How to make a group of object to be randomly stored(or not) in a barrel?

- I guess that the steps' sounds and their paths are hardcoded?

old Re: Scripting Questions

Guest

Quote
Hey... I have a brief question.
Is it possible to make a new health-value bar? Like, up with Health, Hunger, Thirst, and Fatigue, could another one be added?
Just curious!

~Storm

old Re: Scripting Questions

Flying Lizard
User Off Offline

Quote
1. yes, you just have to make a script in the random map profil to randomly rotate items.

2. just make a script in the random map to spawn items s2 cmd create and put them with an other script into the barrel s2 cmd store

3. yes, but you can change the step sound file



4.yes it is possible ( )

old Re: Scripting Questions

Gradir
User Off Offline

Quote
But how will he know which item I mean?
Plus, if it goes about rotating, how should look such a script, because I dont have any idea

About the items in the barrel - I think it's impossible to make the spawned (generated randomly on the random map) barrels have a random amount of something, generated with the map? Or am I wrong? If I am, then how should I script it? I've started to write and came up with this:
1
2
3
4
5
6
on:start
		local $b;
		local $a;
		$a=random(0,5);
		$b=random(2,20);
		if ($a==0) { $id=create("Item",281,0,0,$b; store $id,"object",136; }:us:
To the start Previous 1 211 12 13121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview