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 2 3 4121 122 Next To the start

old Re: Scripting Questions

Builder2-0
User Off Offline

Quote
bizzl has written
the easiest way should be the click screen mode.
You can't emulate the original menus perfectly (no hover für images), but for most tasks it should be enough.

You mean CSCR? If so, then yes, that is what I'm using. However, I thought that perhaps it would be possible to make the buttons "light up" when you mouse over them... Sad.

-Builder

old Re: Scripting Questions

Guest

Quote
hey i have one question. I tried to make that you dont have to hit cotton bush to get some wool so i used the command (on:use find) but i don't know how to set when you use it to much that it dissapears. i hope you understand it.


PS: is there command list in English.

old Re: Scripting Questions

bizzl
User Off Offline

Quote
Gast has written
hey i have one question. I tried to make that you dont have to hit cotton bush to get some wool so i used the command (on:use find) but i don't know how to set when you use it to much that it dissapears. i hope you understand it.


Implement a counter:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
s2:on:start {
	s2:local $amount;
	$amount=10;
}
s2:on:use {
	[i]//To delete the plant
	//use s2:damage "object",currentid(),10000;
	//instead of s2:skip[/i]
	s2:if ($amount==0) { s2:skip; }
	s2:find 48,1;
	$amount--;
}
s2:on:changeday {
	$amount=10;
}

old Re: Scripting Questions

Guest

Quote
How do you increase the player's speed(more than the bloodrush amount)? And how do you make it play MIDI files? It won't play them!

old Script doesn't work

Guest

Quote
i tried player_speed,and it doesn't know what it is.

old Re: Scripting Questions

bizzl
User Off Offline

Quote
LCL-the new! has written
i tried player_speed,and it doesn't know what it is.

If a unit gets this state, it's speed will be the one given as state value, and not the one it has by default.

old Re: Scripting Questions

Guest

Quote
Whenever I try to script something it offers me syntax help in German and the scripts don't work properly, I even copied one from the Scripting Tutorials that failed to work. I have the latest English version for the website. Please help

old Re: Scripting Questions

HW
User Off Offline

Quote
As long as the official Stranded II Site hasn't been translated, there will only be German documentation and syntax help. That no script works surprises me, however. Could you post one of those scripts you tried? And what errormessages do you get/what happens when you execute the scripts?

old The "process" title

Starcom
User Off Offline

Quote
Hi,

Can someone say to me if the title of process script command is displayed or not during the game ?

I ask about this, because I am looking for all script commands generating text on the screen. Actually, I think there is only "msg" commands, but perhaps I am wrong ?

thx

old Re: Scripting Questions

AdidasOFC1
BANNED Off Offline

Quote
process starts a progress with title, like eating. you see the title.

there are also: diary, msgboc and dialogue with text.

EDIT: and decisionwin

old Re: Scripting Questions

maor
User Off Offline

Quote
is there a command that i can use to delete an ai?
(i want to delete all the butterflys from the map while i am in game)

old Re: Scripting Questions

bizzl
User Off Offline

Quote
maor has written
is there a command that i can use to delete an ai?
(i want to delete all the butterflys from the map while i am in game)

There is no difference between an Unit (AI) and anything else.
You'll have to loop over all occurencies of the butterflies and delete them:
1
2
3
4
5
6
s2:loop("unit",7) {
	s2:free "unit",s2:loop_id();
}
s2:loop("unit",6) {
	s2:free "unit",s2:loop_id();
}

old Re: Scripting Questions

Joku
User Off Offline

Quote
Hello. I've just started on a mod that seeks to change the game in many ways, not just add a bunch of extra stuff. Because of this I will have a lot of scripting questions over the next week or two.

First question: I currently have things set up so that upon pressing a user-defined key, the map screen displays. I want to change this so that the map screen will only be displayed if the player actually has a map. I have failed in my attempts so far. Here is the functioning code I have in game.inf:

1
2
3
4
5
6
scriptkey=20, Map
script=start
    on:keyhit20 {
         map;
    }
script=end


Second question: Is there a way to determine the manner in which the player died? I want to make it so something happens when the player drowns, but not with any other kind of death. If not, is it possible to make something happen when killed by shark?

The following may not be a scripting question; it all depends on the answer, really. I want to get rid of hunger/tiredness, but keep thirst. The way I have done this so far is to change the health system to "2" (which gets rid of thirst and tiredness), change everything that normally affected thirst to make it affect hunger instead, change everything that affected hunger to make it affect nothing, modify the "if_values" image to get rid of the bottom two bars, and switch the images for the hunger and thirst bars. This seems to work well enough, but this stat is still listed as hunger in the stats menu. So my question is, is there a way to change the name of the stats in the stats menu, or is there a way to decide which stats are used when changing the health system?

More questions to come.
edited 1×, last 03.09.07 12:02:40 am

old Re: Scripting Questions

bizzl
User Off Offline

Quote
Joku has written
Hello. I've just started on a mod that seeks to change the game in many ways, not just add a bunch of extra stuff. Because of this I will have a lot of scripting questions over the next week or two.

You'll need a bit more time to get a whole bunch of changes down and working
But why another mod? Why not help an existing one?

Joku has written
First question: I currently have things set up so that upon pressing a user-defined key, the map screen displays. I want to change this so that the map screen will only be displayed if the player actually has a map. I have failed in my attempts so far.

That's easy:
1
2
3
4
5
6
7
8
scriptkey=20,Map
script=start
	on:keyhit20 {
		s2:if (s2:count_stored("unit",1,73)>0) {
			map;
		}
	}
script=end

Joku has written
Second question: Is there a way to determine the manner in which the player died? I want to make it so something happens when the player drowns, but not with any other kind of death. If not, is it possible to make something happen when killed by shark?

Not directly. You can try it with on:ai_attack and a timer, but I don't think it will be a easy and well working script.

Joku has written
The following may not be a scripting question; it all depends on the answer, really. I want to get rid of hunger/tiredness, but keep thirst. The way I have done this so far is to change the health system to "2" (which gets rid of thirst and tiredness), change everything that normally affected thirst to make it affect hunger instead, change everything that affected hunger to make it affect nothing, modify the "if_values" image to get rid of the bottom two bars, and switch the images for the hunger and thirst bars. This seems to work well enough, but this stat is still listed as hunger in the stats menu. So my question is, is there a way to change the name of the stats in the stats menu, or is there a way to decide which stats are used when changing the health system?

Try to find the string "hunger" in the strings.inf and change it to "thirst", that should do it.

old Re: Scripting Questions

Joku
User Off Offline

Quote
bizzl has written
You'll need a bit more time to get a whole bunch of changes down and working
But why another mod? Why not help an existing one?


True, I probably will need more time, but this isn't exactly a fully-fledged mod; it's only designed to work with one map.

But why my own mod? That's quite simple: I have my own story to tell.


bizzl has written
That's easy:


It most certainly was. And by this, it is quite clear that I need to study all of the instructions some more. But I tend to lose a lot through Google Translate (which is why I'll be asking so many questions).


bizzl has written
Not directly. You can try it with on:ai_attack and a timer, but I don't think it will be a easy and well working script.


Thanks. I'll see what I can do with it once I get to the point in the development process.


bizzl has written
Try to find the string "hunger" in the strings.inf and change it to "thirst", that should do it.


Simple enough. It worked great. Thanks.


I have a new question now. I want to be able to ride a parrot, and be able to fly around while doing so. Through some experimentation, I have determined that it just isn't possible to fly the parrot in its normal state. I figured it would be possible to get this to work if I could change the parrot's behavior to "airplane". But I can't seem to find the instruction required to change the behavior of a unit. I also tried to replace the parrot with a different one (one which has the airplane behavior), but I failed at that too. Do you know how I can get this to work?

Thank you again for the help you've given.
To the start Previous 1 2 3 4121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview