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 250 51 52121 122 Nächste Zum Anfang

alt WHEEE 1000th Post

Amritsar
User Off Offline

Zitieren
What did you change?

There must of been something that was effected but got changed slightly...

Have you run the working thing in debug mode? It really doesn't matter if it complains but I just wanna know if it's meant to happen...

Maybe I only got the bracket complaint because I stuffed up the playergotitem(250) part?

@DontKnow
Doesn't that mean that this script checks to see if you have zero and if you do it continues?

Or does it mean you have _more_ than 0 items?

alt Re: Scripting Questions

DontKnowToScript
User Off Offline

Zitieren
if you write ==0,you must have 0 items of the type you written.if you write >0,you need to have more than 0 items of that type. and if you written >=0,no matter how many items you have,it always work.

alt Fish

Gast

Zitieren
hello,I need to know How to Fill,a B3d Fish Tank".With game Water,So I can Catch and keep pet fish in game.

alt Re: Scripting Questions

Flying Lizard
User Off Offline

Zitieren
There is no way to do something like that.
The only thing you could do is animate the container that it LOOKS AS IF.
The "water" itself is at a fixed level (y=0)

alt Re: Scripting Questions

Gast

Zitieren
Hi again, I'm back!
This thing was probably talked before, but I can't figure it out.
Skills are not raising and buildings are locked despite of unlockbuilding in game.inf
if someone experienced similar problem, tell me thanks

alt Re: Scripting Questions

Gradir
User Off Offline

Zitieren
Ok, don't mind my previous problem, I had something messed up in the files, managed to find the bugs

I'm trying to make a script which will allow to fry things by dropping near fire, not instantly but after some time (not a process tho, cause it "freezes" the player)

I saw a similar thing in one of the Master of the Woods MOD videos on Youtube.
So far I wrote:
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
id=9
name=meat
icon=gfx\meat.bmp
group=food,std
model=gfx\meat.b3d
scale=0.15
mat=flesh
weight=500
info=blabla
behaviour=throw ammo:450
param=pan_skill,Wert
damage=0
speed=15
drag=1.8
rate=3000
script=start
on:start
	{
	if (parent_class("self")==0)
		{
		local $id,$x,$z;
		$x=getx("self");
		$z=getz("self");
		$id=create("item",10,$x,$z);
		event "create","item",$id;
		free "self";
		}
	}
on:drop
	{
	ai_behavioursignal "eat","raptor",300;
	if ((count_inrange("state",5,50)+count_inrange("state",4,50))>0)
		{
		timer 0,3000,1,"frying";
		}
	}
on:frying
	{
	create "item",10;
	freestored "unit",1,131,1;
	ai_signal "attract",1000;
	fry;
	event "iskill_cook","global";
	skipevent;
	}

the problems are:
1) it creates fried meat after 3 seconds at the position of the player, not the actual dropped item
possible solution - maybe creating an info where you drop the item? is there an easier way?
2) strange amount problems - sometimes it fries the item 2 times and I keep getting more meat I fried

alt Re: Scripting Questions

DontKnowToScript
User Off Offline

Zitieren
@Gradir
first,the { needs to be within the line like this:
1
2
3
4
if (count_inrange(...)>0) [b]{ [/b]
not this:
if (count_inrange(...)>0)
{
second,after the timer ends,make this:
freetimers "self";
freevar $id,$x,$z;
also,look this:
1
2
3
4
5
....
on:frying {
...
skipevent; (wtf???)
}
y do you wrote skipevent??
also,y is the freestored?the item is dropped already!you need to use free "self";!

alt Re: Scripting Questions

Gradir
User Off Offline

Zitieren
Yea, the thing with freetimer might help with the second problem.
But I'm not sure if Stranded keeps track of items on the ground, because using 'free' command with proper item's id seems not to find it and doesn't work?

Also, { don't have to be in the line I know most people probably write like You said but I like setting them in another line, it helps me to keep track of the brackets

alt Re: Scripting Questions

DontKnowToScript
User Off Offline

Zitieren
the free works.i tried myself.
the bracket thing,i thought all ppl are like me that it helps me counting it exactly.
the "free" gets the id you write like this:
1
free "item",203;
lets say that id 203 is a meat.it will delete the meat.

alt Re: Scripting Questions

Gast

Zitieren
it doesnt work, I dont know how to get the correct ID of exactly the item dropped or something

alt Re: Scripting Questions

Gradir
User Off Offline

Zitieren
oh yeah, it works!
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
on:drop
	{
	$mieso=currentid();
	$miesox=getx("self");
	$miesoz=getz("self");
	if ((count_inrange("state",5,50)+count_inrange("state",4,50))>0)
		{
		timer 0,3000,1,"pieczenie";
		freetimers "self";
		}
	}
on:pieczenie
	{
	create "item",10,($miesox),($miesoz);
	fry;
	free "item",$mieso;
	freevar $mieso, $miesox, $miesoz;
	freetimers "self";
	}
It works fine when you drop one meat near the fire. Too bad there are complications, when dropping more, or even having more than one in backpack (not sure)
maybe I should use global timers

Nevertheless, thanks for help DontKnow

alt Re: Scripting Questions

DontKnowToScript
User Off Offline

Zitieren
np..
P.S.what is mieso?what is pieczenie?
is it in polish?
strange..
oh,maybe use a variable that stores the amount of meats,and creates the amount of meats fried?
like this:
1
2
3
$class=current_class();
$id=current_id();
$amount=getamount ($class,$id);
and then,in the "pieczenie" event use freevar for all these,but before that make:
1
2
3
4
5
...
on:pieczenie {
$create=create ("item",10,$miesox,$miesoz);
setamount $create,$amount;
freevar $amount,$id,$class
try it.

alt Re: Scripting Questions

Gradir
User Off Offline

Zitieren
It doesn't seem to work.
I had similar amount problems when I was trying to spawn 2 items (coconut fragments) on impact when coconut was thrown at something. In that case, due to bug player had to have at least 2 coconuts in his inventory, cause else there were strange glitches (like additional coconut fragments spawning at the center of the map)
Well I recently saw the Czechstention Mod people managed to make a stable version of the code for this, along with not letting the player to fry more than 1 item at a time, I should look upon their script
oh and yea they are polish words ;P

alt Re: Scripting Questions

HudaJan
Super User Off Offline

Zitieren
Uhm.. I'd like to know if is there some way to get rid of the flash (s2 cmd flash) cause if I put speed of the flash to 0 and alpha to about half it looks like coloured view, and I need that, but it is there forever and I need it for e.g. one day...

alt Re: Scripting Questions

Flying Lizard
User Off Offline

Zitieren
I've already tried out before what you're trying to do. I think the easiest way to solve this would be to create a colored box around the player that moves together with him.
Zum Anfang Vorherige 1 250 51 52121 122 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtStranded II-ÜbersichtForenübersicht