English Scripting Questions

2,429 replies
Goto Page
To the start Previous 1 2 ... 121 122 Next To the start
26.02.11 10:23:51 am
Up
Kirschkaffee
User
Offline Off
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 has written:
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 has written:
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 has written:
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 has written:
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 has written:
The last thing i need to know is where i add crafting recipes

Combinations.inf

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

Buildings.inf

TehNinja65 has written:
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.
26.02.11 11:27:22 pm
Up
hoodedbella
User
Offline Off
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
edited 4×, last 27.02.11 05:43:56 am
07.03.11 04:00:13 pm
Up
Psytechnic
User
Offline Off
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.
07.03.11 06:20:00 pm
Up
Hurri04
Super User
Offline Off
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.
08.03.11 07:48:37 am
Up
Psytechnic
User
Offline Off
I had a look, but I can't seem to find the item you're talking about.
08.03.11 08:55:18 am
Up
Kirschkaffee
User
Offline Off
the drums are in items_mc_leaf.inf .. ID 781.
19.03.11 04:05:19 am
Up
UnIdEnTiFiEd
User
Offline Off
How can i make it that when i'm about 80% hungry it plays a .wav file?
owner of "Eagle mod" and "Survival Stories mod" and Halo Mod for stranded 2. Also make games, http://www.unrealsoftware.de/forum_posts.php?post=249591#jn
19.03.11 05:23:32 pm
Up
Hurri04
Super User
Offline Off
Code:
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.
20.03.11 12:36:14 am
Up
UnIdEnTiFiEd
User
Offline Off
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?
edited 2×, last 20.03.11 03:12:53 am
owner of "Eagle mod" and "Survival Stories mod" and Halo Mod for stranded 2. Also make games, http://www.unrealsoftware.de/forum_posts.php?post=249591#jn
20.03.11 12:02:36 pm
Up
Hurri04
Super User
Offline Off
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...
To the start Previous 1 2 ... 121 122 Next To the start