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 2121 122 Nächste Zum Anfang

alt Re: Scripting Questions

Kirschkaffee
User Off Offline

Zitieren
Before answering this, i advice you to do the scripting tutorial and reference. It would be too complex to explain the specific script commands.

http://www.strandedonline.de/s2_mods.php?setlan=en

TehNinja65 hat geschrieben
to do that, i need to mess around with the map generator; where would i find the files to modify this?
I guess you are referring to the random map scripts? They are located in the sys-folder and are called random_whatever.inf

TehNinja65 hat geschrieben
Also, how would i add specific ways for the map to generate? (I want buildings to be on the sides of roads... if that is too hard i could make the map generator make the entire terrain a road and just place buildings on it.)


So you just want a road through that map. That would require much grafical prework with the textures in the gfx-folder. Not sure about that, but i would try to make a texture that looks like the entire terrain and import it into the map editor. if it looks good, then you can use the texture in the randommap-script with terraintexture <pathoftexture>;

TehNinja65 hat geschrieben
Also, is there a specific 3d modeler i need to use for Stranded 2, or can i just use blender? And what do i convert the files to/where do i put them?
Blender works fine, you have to export the models into *.b3d format. I am using Milkshape3D, but its no freeware like Blender. By default you place your modelfiles into the gfx-folder, b3d-format.

TehNinja65 hat geschrieben
In addition, i want to add a new enemy (zombie) and remove the existing ones. How would i do that?
There are zombies in Stranded II? O.o Anyway check out the units.inf in the sys-folder, i think you are smart enough to understand the definition pattern, if you are coding python.

TehNinja65 hat geschrieben
The last thing i need to know is where i add crafting recipes

Combinations.inf

TehNinja65 hat geschrieben
and how do i add the materials to use for these buildings? (Like logs or branches or leaves in your inventory:

Buildings.inf

TehNinja65 hat geschrieben
how do i add materials that can be harvested and used?)


Objects-files and item-files.

You really should take some time and look into the .inf-files in the sys-folder, they are quite self explaining.

alt Re: Scripting Questions

hoodedbella
User Off Offline

Zitieren
Umm it worked eventually after messing around with it for a while.
I also had few other questions, is it possible for scripts in a map set to a specific unit to affect another, cos im am currently making a map on stranded 2.5 graphical mod and when i try to attach the ai_stay "self",1; to a unit it does'nt effect the said unit in the slightest but i already have 3 units using the same command without a problem.

Also is it possible to make a script were a unit would'nt attack you till you picked up a specific item or finished a perticular dialog option?

And to change a model that your talking to after a dialog option?

how would you script a given task were you have to destroy multiply objects

can you make a unit attack the player till there health was almost out then stop?

can you spawn a unit after a dialog option with a state on it for example 'tame'.

     
     thank you for your help.
     and sorry for the list but i thought
     it more practical then multiple posts
     sorry for the edits but i got more qustions
     while waiting for answer
4× editiert, zuletzt 27.02.11 05:43:56

alt Re: Scripting Questions

Psytechnic
User Off Offline

Zitieren
I'm thinking of making a new object, but I'm unsure how to script it.

I want to make a scarecrow as a buildable object so that any locus in range of the scarecrow are repelled out of the range. I was wondering if there is a way to script this into the object constructor.

alt Re: Scripting Questions

Hurri04
Super User Off Offline

Zitieren
there is a drum in the extension mod which attracts kiwis when played.

I think you should be able to use this script, negate the signal from "attract" to "distract", fix the IDs and Type-numbers and set it up to be executed by a timer which is started locally at the scarecrow on:build_finish.

alt Re: Scripting Questions

Hurri04
Super User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
on:start {
	timer "unit", 1, 1000, 0, "hunger";
}

on:hunger {
	if(getplayervalue(2)>=80) {
		play "soundfile.wav";
	}
}
this goes into the global script of the map.

alt Re: Scripting Questions

UnIdEnTiFiEd
User Off Offline

Zitieren
Thanks, and how can i make it that when birds die, they dont fall at the speed of sound but rather the same speed as the player jumping?


EDIT= also, how can it be that, if a certain unit goes near a certain object, the unit will disappear and the object will turn into another object. and then when i use the new object, it gives me an item and turns back into the first object

because i have a pig model and a pig trap, so im trying to make the trap able to kill the pig. also how do i make the pig attack me only if i attack it?
2× editiert, zuletzt 20.03.11 03:12:53

alt Re: Scripting Questions

Hurri04
Super User Off Offline

Zitieren
the bird-falling-thing is something that can only be changed in the source code.

for the pig trap:
use the commands s2 cmd timer, s2 cmd count_inrange, s2 cmd inrange, s2 cmd free, s2 cmd loop, s2 cmd loop_id s2 cmd model.
make the timer be local at the trap and run it every second.
then, on the event which is executed by the timer, use the count_inrange command to check whether the number of pigs near the trap is 1 or more.
if so, use the loop command and the loop_id command together with the inrange command to check which pig is closest to the trap.
then use the free command to delete the pig and the model command to change the model of the trap to the second model with the pig in it.
when using the second trap you can use the model command again to change the model back to the first one.


I'd suggest you try to write a script on your own first and if you should have any problems you can still ask for more help.
but I see that you have a very lot of scripting questions and I think you should learn how to write scripts yourself by now and rather not only rely on others to do the work
the script you asked for isnt that hard to do and I'm sure that you are able to do it yourself (or at least a lot of it) once you know the commands you need to use
so have a little look at the commands I linked to above, look at the order in which the commands have to be executed and think a litle bit logically and you wont have many problems for sure

also you can use a translator if the references of any of the commands shouldnt be available in english language. I tried it out some time ago and the content of the descriptions seems to be understandable after the translating, even if there might be some little issues concerning the grammar...
Zum Anfang Vorherige 1 2121 122 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtStranded II-ÜbersichtForenübersicht