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 251 52 53121 122 Next To the start

old Re: Scripting Questions

Guest

Quote
Hi...

I'm mod'ing my stranded a bit for my own amusement.
I'm not really good at it but I'm getting better.
Have implemented some new items/combinations etc.
Inspired by the Realism Mod, I'm trying to implement brewing atm.

I've run into a bit of a problem. I'm getting 'script error' but I'm not really good at doing debugs.
I've searched the forum and google et al. but cant find anything.

Debug is giving me this info:
SCRIPT ERROR:
Item 8808 (juice type 47)
Mismatched brackets.
Event changeday
Row 10
Col 1
Script }

Thats it...

My script is looking like this:

script=start
on:create {
local $age;
$age=1;
}
on:use {
msg "Aged for $age days",3;
}
on:eat {
process "drinking",2000;
drink 0,0,40,0;
find 106;
}
on:changeday {
if ($age>=0){
$age++;
if ($age>=2){
msg "This should work",3; //debug
alterobject "self",611;
event "iskill_brewing","global";
}
}
}
script=end


..

I figured (because of the debug message) that the problem had to be in the changeday section. And a // edit confirmed that the above was working. I fiddled around with the changeday part and couldnt get it to work.
Now I get the (exact same) error message even if I //-out the entire script.
This has me believing that the error must be somewhere else. But I cant figure it out, as I dont know how to decifer the debug error-message.
I edit in INF-editer - and the numbers given from debug dont really make sense in regards to line-count etc.

Can you guys (/girls) spot the problem - explain to me how to locate the error, or maybe just give me link to a site explaining how understand the debug-messages?

I would very much appreciate it, as it has now wasted many hours of my mod-time, and I'm starting to feel really discouraged.

Thanks in advance (and fingers crossed)

Rasmus

Btw:
I have tried to make "alterobject" to "alteritem" but got a lot of error messages saying, that alteritem can only be used "on use" if there are three or less parameters, whatever that means.

@Flying Lizzard: Sorry for the wrong post. I must have been really distracted when posting for not seeing this thread.

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
on:changeday {
     if ($age>=0){
          $age++;
     }
     if ($age>=2){
          msg "This should work",3; //debug
          alterobject "self",611;
          event "iskill_brewing","global";
     }
}
script=end

You had brackets in the wrong places. (btw putting a space at every line after else,on,if,and elseif makes it easy to understand )

old script's

Guest

Quote
hi! im from poland so i can make a few mistakes i start play stranded long time age and i cant make scripts i work on my first map and i need script for native so that he stay in 1 position. and script to trade with him. i hope you understand me

old Re: Scripting Questions

DontKnowToScript
User Off Offline

Quote
to make something stay,use
1
ai_stay "self";
or something else like "unit",5)
to trade,make a dialogue and use
1
2
3
4
trade=start
sell=//id of the item you want to give him
buy=//id of the item you want him to give you
trade=end

old Re: Scripting Questions

Gradir
User Off Offline

Quote
hey there
Is there a way to predict the way the tree-falling animation will be facing (the rotation of the object) or is it random?

and, I suppose there is no way to disable it? (except for tricky deleting the tree just before it will be cut down :P)

oh, and another thing - is it possible to speed up spawning fruits for a specific object?
edited 1×, last 29.10.08 06:00:23 am

old Re: Scripting Questions

DontKnowToScript
User Off Offline

Quote
@Gradir
the spawn command is like spawn=ID,Amount of days to grow... (and others) so change time to grow.
jayjay:
dialogue "the name of //~name in your source","sourcefile".
then the pages,and outside and text=start and text end make trade=start
sell=id
buy=id
trade=end

old Re: Scripting Questions

Guest

Quote
@Bloodshot: Thx for the help!

I kept on getting error messages. Must have messed something up. Had to reimplement my stuff.
Now I get no error.
But I can not get the " alterobject "self",611; " to work.
The script seems to ignore it. Figure it must be because Im trying to change an item no an object.
But alteritem doesnt work on changeday.
I thought of doing a "add item"->"delete item".
But I do not know how to make this applicable to the local item everywhere. The script must apply regardless of if the item is in inventory, a barrel or on the ground.
Do you have an idea on how to make this work?
Thanks again.

Rasmus

old Re: Scripting Questions

DontKnowToScript
User Off Offline

Quote
to make something store inside something,use s2 cmd store ID,ObjectID to store something.
now,you should use event use.
and then,use create "class",ID,X,Z,and if you want,amount and then free "self".

old Re: Scripting Questions

Guest

Quote
@Dontknowtoscript:
Thanks for the help. Unfortunately I do not fully understand what you suggest.
My script loks like this:

script=start
on:create {
local $age;
$age=1;
}
on:use {
msg "Aged for $age days",3;
}
on:eat {
          process "drinking",2000;
          drink 0,0,40,0;
          find 106;
     }
     on:changeday {
          if ($age>=0){
               $age++;
          }
          if ($age>=2){
      msg "This should work",3; //debug
           freestored,255,39,1;
           store 255,"item",39,1;
           }
     }
script=end

I want to make the item change into another item (or delete the item and create the other item). The catch is, that the item needs to change by itself when the agecounter is met., - and no matter where (inventory, crate, ground). Alternatively it would be fine if it had to be stored in a certain object like a barrel.
I just cant figure it out...

I would realle appreciate if you could show me how to rewrite these lines:
if ($age>=2){
      freestored,255,39,1;
           store 255,"item",39,1;
          }

Would be awsome. Thanks alot in advance.

Regards

old Re: Scripting Questions

Johnny95
User Off Offline

Quote
Welcome everyone!
I am going to make my own map. You noticed most probably that in the game in coming to iron or to the well an entry of the diary appears. How to do such an automatic entry which would turn up at coming up to the determined place or after raising the determined subject in the editor?

Sorry for my english... I hope you are understand

old Re: Scripting Questions

DontKnowToScript
User Off Offline

Quote
make an areal trigger like :
1
2
3
4
5
6
7
8
9
set radius
click instant active
set script to:
on:trigger {
add "want you want to write";
add "another line you want to write";
add "more writing...";
diary "title";
free "self"; (if you want it to show one time)

old Re: Scripting Questions

Johnny95
User Off Offline

Quote
On my map i made an areal trigger. And in his script i pasted:
set radius
click instant active
set script to:
on:trigger {
add "want you want to write";
add "another line you want to write";
add "more writing...";
diary "title";
free "self"; (if you want it to show one time)

Nothing happened. did I do the right thing?
To the start Previous 1 251 52 53121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview