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 2105 106 107121 122 Next To the start

old Re: Scripting Questions

lucas is stranded
User Off Offline

Quote
Hurri04 has written
1. where you find the scripts:
Quote
[Stranded II File]/mods/Stranded II/sys/scripts/random_char_chieftain.txt
                                                                      /random_char_hempguy.txt
                                                                      /random_char_native.txt
                                                                      /random_char_pirate.txt
                                                                      /random_char_prof.txt
                                                                      /random_charscript.txt


2. you might try this:
after throwing 5 meat at the raptor (I think its 5) it says the raptor is tamed now but when riding him he will drop you quiete often.
solution: throw 5 more pieces of meat at him and he will be really tamed.



Thanks for the script location.



But... Is the raptor thing true or you're just guessing?

old Re: Scripting Questions

lucas is stranded
User Off Offline

Quote
Taming the raptor twice actually worked... ._.


I found the scripts, but when I add them to the NPCs nothing happens, I press E near them and nothing...


This is what I do:

1. Find the script for the corret NPC (pirate script for pirate unit).

2. Select the script.

3. Press the green V button to confirm.

4. Go back to the editor.


Am I missing something?

old Re: Scripting Questions

Hurri04
Super User Off Offline

Quote
you dont have to copy&paste the script from the "random_char_pirate.s2s" file. if you have a look at it you might notice that this is the way dialogues are scriptet in Stranded and therefore you cant write this script into the pirate's scripting box.

what you have to do is open the file "random_charscripts.s2s" and select the right lines of the script (there are comments so you can see which script belongs to which character) and then copy&paste these (3!) lines into the characters scipting box.

old Re: Scripting Questions

Solve
User Off Offline

Quote
ive made a npc shot projectile att me, but they shoot across the hole map, how do i make the range of the guy lesser? and when he dies he still shoots, ive tryde
on:kill {
freescripts;
}
but i dosent work, plz help me

old Re: Scripting Questions

UnIdEnTiFiEd
User Off Offline

Quote
whats wrong with this script for my random island?

=spoiler=


################### Random Profile: Endless Game

id=25
name=Endlosspiel - Northern


################### Scripts

script=start
     on:preload {
          // Set Startpoint in Sea
          $size=mapsize();
          $size=$size/3;
          $id=create("info",1,$size,$size);
          setpos "info",$id,"self",2,"self";
          // Random Startscriptstuff
          extendscript 0,0,"sys/scripts/random_start.s2s";
          //options
          $s2g_global_options=create("info",34,0,0);
          addscript "info",$s2g_global_options,"sys/scripts/random_options.s2s","options";
     }

     on:start {
          $id=create("info",59);
          event "start","info",$id;

          if (varexists("ri_init")==1) { skip; }
          $ri_init=1;
//          timer 0,1000,1,"stdiary";

          // Start Items
          $id=create("item",44,0,0,10);
          store $id,"unit",1;
          $id=create("item",66,0,0,10);
          store $id,"unit",1;
          $id=create("item",38,0,0,10);
          store $id,"unit",1;
          $id=create("item",47,0,0,5);
          store $id,"unit",1;
          $id=create("item",118);
          store $id,"unit",1;
          $id=create("item",456);
          store $id,"unit",1;
// Test
/*          $id=create("item",792);
          store $id,"unit",1;
          $id=create("item",86);
          store $id,"unit",1;
          $id=create("item",71);
          store $id,"unit",1;
          $id=create("item",402);
          store $id,"unit",1;
          $id=create("item",28);
          store $id,"unit",1;
          $id=create("item",49,0,0,10);
          store $id,"unit",1;
          $id=create("item",96,0,0,10);
          store $id,"unit",1;
          $id=create("item",760,0,0,10);
          store $id,"unit",1;
          $id=create("item",765,0,0,10);
          store $id,"unit",1;
          $id=create("item",766,0,0,10);
          store $id,"unit",1;
*/

          // Settings
          $s2g_firesuccess=60;
          $s2g_plagues=100000;

          // Forced Creation of Important Stuff
          if (count("object",75)==0){ randomcreate "object",75,1,500; }      // Watersource
          if (count("object",121)==0){ randomcreate "object",121,1,500; } // Grain
          if (count("object",47)==0){ randomcreate "object",47,1,500; }      // Cotton
          if (count("object",769)==0){ randomcreate "object",769,1,500; }      // Copper
          if (count("object",500)==0){ randomcreate "object",774,1,500; }      // Ironstuff
          if (count("object",850)==0){ randomcreate "object",850,1,500; }      // Flintstone
          // Cotton Spawn
          loop ("objects",47){
               $id=loop_id();
               $x=getx("object",$id);
               $z=getz("object",$id);
               $id=create("info",45,$x,$z);
               info_spawncontrol $id,50,"object",47,1,3,1;
               starttrigger $id;
               exit;
          }


          // Remove Killerwhales close to Player
          loop ("units"){
               $id=loop_id();
               $type=type("unit",$id);
               if (($type==485)or($type==485)){
                    if (playerdistance("unit",$id)<1000){
                         free "unit",$id;
                    }
               }
          }
     }

     on:stdiary {
          if (varexists("ri_hello")==1) { skip; }
          $ri_hello=1;
          // Start Diary
          add "Du bist gestrandet.";
          add "Versuche zu überleben - ansonsten gibt es hier kein bestimmtes Ziel.";
          add "Viel Spaß!";
          add "";
          add "!4Schwierigkeit: Einfach";
          add "Viele Ressourcen und keine gefährliche Tiere.";
          add "Du hast einen großen Startproviant um die ersten Tage zu überstehen.";
          add "Außerdem verfügst du über ein Erste-Hilfe Set.";
          diary "Gestrandet";
     }

     on:changeday {
          $mapc=mapsize();
          $mapc=($c/512);
          // Spawn Birds
          if (count("unit",25)<$mapc){ randomcreate "unit",25; }
          // Spawn Butterflies
          if (count("unit",6)<$mapc){ randomcreate "unit",6; }
          if (count("unit",7)<$mapc){ randomcreate "unit",7; }          
          freevar $mapc;
     }
script=end


################### Objects



### Trees
range=50,270
ratio=10
objects=10,12,13,14,16
ratio=7
objects=15
ratio=5
objects=18,195,350,352,353,354
ratio=2
objects=11,17

### Bushes
range=30,240
ratio=30
objects=33
range=50,250
ratio=10
objects=31,32,33,36,37,38,185
ratio=3
objects=34,39,40,41,42,351
ratio=6
objects=35,42,45,46,47
range=-10,10
ratio=5
objects=43
range=-500,-50
ratio=5
objects=48

### Stones
range=-5,500
ratio=20
objects=63
ratio=15
objects=65,850
ratio=5
objects=64,67,68,69
ratio=9
objects=769,774
ratio=7
objects=73,74,75
ratio=1
objects=71,72,771
ratio=15
objects=60,61,62
ratio=7
objects=66

=
### Stuff
range=50,100
ratio=5
objects=120,130,131,134,135
ratio=15
objects=121


################### Units

### Land
range=,40
ratio=15
units=500
range=10,200
ratio=20
units=497,496,495,492,490,489
ratio=10
units=500
range=50,150
units=492
ratio=5
units=492
ratio=3
units=492

### Sky
range=-100000,100000
ratio=10
units=492
ratio=5
units=492,485

### Sea
range=-100000,-70
ratio=20
units=499,486,487,488

################### Items

### Stuff
range=60,200
ratio=6
items=7,15,21,22,23,24,25,26
ratio=4
items=31,32,33,16,17,19,20
ratio=2
items=34,35,18
range=0,30
ratio=10
items=102
ratio=5
items=103
range=-150,0
ratio=20
items=40

old Re: Scripting Questions

Hurri04
Super User Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Test
/*	$id=create("item",792);
	store $id,"unit",1;
	$id=create("item",86);
	store $id,"unit",1;
	$id=create("item",71);
	store $id,"unit",1;
	$id=create("item",402);
	store $id,"unit",1;
	$id=create("item",2;
	store $id,"unit",1;
	$id=create("item",49,0,0,10);
	store $id,"unit",1;
	$id=create("item",96,0,0,10);
	store $id,"unit",1;
	$id=create("item",760,0,0,10);
	store $id,"unit",1;
	$id=create("item",765,0,0,10);
	store $id,"unit",1;
	$id=create("item",766,0,0,10);
	store $id,"unit",1;
*/

I dont think these are valid characters in the script:
1
/*
1
*/
instead of, you have to write
1
//
in front of each of these lines to mark them as comments so they wont be executed (if that is what you intended to do)

further I have seen this:
1
2
3
4
5
6
7
=
### Stuff
range=50,100
ratio=5
objects=120,130,131,134,135
ratio=15
objects=121
I think the equals sign is wrong here, just remove it.


More >




Edit:
@ Solve:
if you'd post the full code you used we might be able to help you
edited 1×, last 05.09.10 04:16:19 pm

old Re: Scripting Questions

Hurri04
Super User Off Offline

Quote
no, you cant solve this by scripts.
you have to edit the description-file of the arrow, somewhere in its description there is a line
1
speed=x
instead of the 'x' there is a number, of course.
just edit that number to make the arrow fly faster or slower.

(the description file is the file "items_weapons.inf" in the sys-folder, the items has the ID 53.)

old Re: Scripting Questions

UnIdEnTiFiEd
User Off Offline

Quote
Thanks!! I always found it weird how arrows are slow in stranded

EDIT= whats a script so on the start of every map you start with 2 or 3 items?? No matter what!!
edited 1×, last 11.09.10 12:33:59 pm

old Re: Scripting Questions

Hurri04
Super User Off Offline

Quote
write this into th eglobal script of the map:
1
2
3
on:start {
	find [ITEM-TYPE], [AMOUNT];
}

replace [ITEM-TYPE] with the number of the type of item you want to have on the start.
replace [AMOUNT] with the amount of the item you want to have on the start.
you can repeat the s2 cmd find command as often as you need it.

old Re: Scripting Questions

Hurri04
Super User Off Offline

Quote
I think the easiest way to di that would be to do the following things:

set an info at the center of the are where the animal spawn (use a flag or soemting like that) and write the following script into it:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
on:start {
	timer "info", [ID of the flag], 5000, 0, "addstatetounit";
}

on:addstatetounit {
	if(count_inrange("unit", [UNIT-TYPE], [Radius], "info", [ID of the flag])>0) {
		loop("units", [UNIT-TYPE]) {
			$unitinrange=inrange("unit", loop_id(), [Radius], "info", [ID of the flag];
			if($unitinrange==1) {
				addstate "unit", loop_id(), "[State]";
			}
		}
	}
}

this should add the state of your choice to each unit that spawn inside the radius within at least 5 seconds after it spawns (to keep the framerate up I made the timer repeat all 5 seconds, if that is too slow you might try 2500 instead of 5000).

list of all possible states
write either the number of the state or its english name into the addstate command in the script. if you choose to write the number leave the quotation marks away.

old Re: Scripting Questions

Lion_Hearted
User Off Offline

Quote
Ok... I've been wondering for a while now on this...


I want to change jumps into wing flaps... meaning, normally you make a little hop when you jump... and when your hop is over, then you can jump again...


I was thinking more like, making jumps in succession without waitting for you to reach the ground, in that cause it would simulate flapping wings...

Like... press spacebar once, and wait till you get to the ground, would be just like a bird, lifts its wings just for a sec to hop a meter to another spot of ground.

However, pressing spacebar twice will give you an even bigger boost... allowing you to "fly" further then just a normal hop.

And as for flying...

Press spacebar rapidly, to do multiple flaps till you get up where you want to be, then press spacebar periodically to stay in flight... then landing wherever you want to land...


I was just wondering if this was even possible with the stranded two the way it is, or would someone have to go into the source code and change it to allow someone to press the space bar multiple times...



And if it is possible without changing the source code, would someone give me a hint as to where to start such a script? I may be a learning scripter however I'm no where near professional status yet...

old Re: Scripting Questions

Vectarrio
User Off Offline

Quote
@Lion_Hearted:
I know only one thing:
go to game.inf
change jumptime and jumpfactor
jumptime makes interval between jump and fall - bigger.
jumpfactor makes jump higher
But jump=jumpfactor*jumptime, if i am right

old Player modifications

thecode
User Off Offline

Quote
Hello all
Aboves all sory for my bad english (I am french)
My questions:

-How to define the sleep to 52%, Health to 82%, the thirst and to 12% and hunger to 23% at the beginning please?

-How do the player's skill increases?
Me, I would put 128 in gardening, and 58 logging

I'm going on the official site to see the codes but not explaining how to put my codes. It does not work

Sorry,thank you:)
To the start Previous 1 2105 106 107121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview