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 268 69 70121 122 Next To the start

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
Anyone find a problem in this? it says the famous Memory Acsess Violation and I've tried everything
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
###Water Wheel
id=63
name=Water Wheel
group=vehicle
ani_idle1=1,47,0.25
scale=1
health=100
behaviour=vehicle
sfx=watercraft
icon=waterwheel.bmp
model=waterwheel.b3d
colxr=100
colyr=100
loopmoveani=1
script=start
	on:kill { free "self"; }
script=end

old Re: Scripting Questions

The Second
User Off Offline

Quote
@Vectar666:
Vectar666 has written
I mean
1
2
3
$pitch=??
$yaw=??
setrot"object",currentid(),$pitch,$yaw,0;

I think you can use s2 cmd getpitch and s2 cmd getyaw. Will it work? Like this:
1
2
3
$pitch=getpitch "class", id;
$yaw=getpitch "class", id;
setrot"object",currentid(),$pitch,$yaw,0;
edited 1×, last 12.07.09 10:45:06 am

old Re: Scripting Questions

aimeewilbury
User Off Offline

Quote
Is there a behavior or script to create a unit as "amphibious vehicle," one that can both ride on land and on top of the water?

old Re: Scripting Questions

jockmo42
User Off Offline

Quote
Trying to make a lionstone spawn a snail when killed if there are no stones left on the island, just as a test. The snail won't spawn. No errors.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
### Lionstone
id=199
name=Lion Stone
group=stuff
icon=gfx\lionstone.bmp
model=gfx\lionstone.b3d
health=300
mat=stone
find=23,60,1
find=21,60,10
find=11,20
find=71,15
scale=1
var=radius,Radius,500,0
var=count,Lions per Day,1,0
var=max,Lions max,1,0
var=radius2,Radius,7000000,0
var=count2,Lionstones per Day,1,0
script=start
	on:changeday {
		loop("count",$count) {
			if (count_inrange("unit",9,$radius,"self")<$max){
				create "unit",9,getx("self"),getz("self");
			}
		}
	}
	on:kill {
		loop("count",$count2) {
			if (count_inrange("object",199,$radius2,"self")=0){
				create "unit",18,getx("self"),getz("self");
			}
		}
	}
script=end

Any ideas?

old Re: Scripting Questions

Amritsar
User Off Offline

Quote
I can't see the error Jockmo but I haven't looked at scripts in ages and I always seem to have a problem with the on:kill { scripts not working anyway.

aimeewilbury: I had a look in units and I changed my mind. The Turtle has the amphibious class so you could try using that. Okay I just tried something similar (2nd edit) -- and you _could_ use that and it would work but the the vehicle is very likely to move on it's on for no particular reason.

While I'm here though. Can anyone tell me exactly what I'd need to do to get Bamboo and Cotton to respawn 3 days after dieing? I assume it's the $tmp=spawntimer "self" line but that didn't seem to work. I can't get to my code right now so I can't get the exact quote but after failing I just copy/pastad the code for the hemp and still nothing happened. Set the timer for 1 day, slept for 3 and no respawn.
edited 2×, last 13.07.09 08:41:23 am

old Re: Scripting Questions

jockmo42
User Off Offline

Quote
Bloodshot has written
Jockmo: You used one = on the if, you need two:==


Thanks a bunch, now it works fine. The range didn't work, but I just made it check the whole island.
edited 2×, last 14.07.09 04:37:25 am

old Re: Scripting Questions

firedrake101
User Off Offline

Quote
1Q.i need to know how to make ppl stop moving

2Q. and make diary entries

3Q.and make the camer move when u get to a certain place or sumthin

4Q.why cant i talk to anybody?i go up to them and press e?does it affect anything if i change texts and try to add new buttons n stff?(P.S. i have no clue on scripting but i know how to change them to my advantage, my char has 999999999 health and9999999 attack and attack range, sweet huh?)

plz answer
edited 1×, last 14.07.09 07:15:31 am

old Re: Scripting Questions

Amritsar
User Off Offline

Quote
Which people do you want to stop moving? I'm relatively sure it is defined by their behaviour. To freeze while keeping the behaviours such as normal/bird/raptor and etc would probably require a script.

Who are you trying to talk to? Unless you've broken something the generic pirate/prof/chief will all speak when you've pressed E.

The random chieftan/pirate/hempguy/etc convos are all contained in "stranded2_en\mods\Stranded II\sys\scripts" and are the random_char_***.S2S files. Open with notepad and you can change some of the conversations and trades slightly.

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
there is another way: ai_stay "self",1; Keeps them in place.
2A. diary "Title","sys\diary1.txt"; as an example.

old Re: Scripting Questions

aimeewilbury
User Off Offline

Quote
Is there a way to create scuba-diving gear? Endless air for underwater? I tried looking through all the references (with Google Translate) and not sure what to use. I can use existing models/gfx.

Basically: If you "use" it, it's on, and if you enter the water, you have no air limit.

old Re: Scripting Questions

Amritsar
User Off Offline

Quote
I wish you had posted that last week Bloodshot =/ I had to make my vehicle behaviour=standandshoot to make it not run off lol. And then I had to edit all the range so I wasn't constantly being killed by an inanimate object.

Aimee: Not sure but I'd imagine you'd have a loop that affects on:use which constantly gives      "air 20000;". Like I said not sure but it's worth a look.

While I'm here... Why does this script make the unit have no collision?

### Cart
id=50
fx=16
name=Wooden Cart
group=vehicle
icon=gfx\eagle.bmp
model=gfx\crate01.b3d
scale=1.0
behaviour=standandshoot
health=200
speed=1.4
mat=wood
rideoffset=40
range=0
damage=0
attackrange=0
turnspeed=0.5
script=start
     on:use {
          clear;
          add "You can drive this raft or store stuff inside.";
          add "What do you want to do?";
          msgbox "Sailraft";
          local $id;
          $id=current_id();
          add "exchange 2,$id;";
          button 0,"Store stuff",19;
          add "ride $id; closemenu;";
          button 1,"Drive the raft",8;
          add "closemenu;";
          button 2,"Do nothing with this raft",3;
          freevar $id;
     }
     on:kill { free "self"; }
script=end

old Re: Scripting Questions

firedrake101
User Off Offline

Quote
can anyone tell me how to make more than one level? like when you get to a certain place it brings you somewhere else?

and can someone tell me how to use the camera?
how do i make people move when im not controlling them?and how do i make it move when you get to a certain place or just move at beggining?

plz answer thnx u :3

old Re: Scripting Questions

The Second
User Off Offline

Quote
firedrake101 has written
can anyone tell me how to make more than one level? like when you get to a certain place it brings you somewhere else?

use s2 cmd loadmap script.
example:
1
loadmap "maps\your map's name",1,1,1,1;
just put there the right event.

firedrake101 has written
and can someone tell me how to use the camera?
how do i make people move when im not controlling them?and how do i make it move when you get to a certain place or just move at beggining?

plz answer thnx u :3

Use s2 cmd movecam. Example:
1
2
3
4
5
6
on:start {
   seqstart;
   movecam 1, 1, infoID; //place whare it starts//
   movecam 1, 5000, infoID; //next info//
   segend 5000; //Time when it stops//
   setat "unit", 1, "info", infoID; //Where you want player is when "film" stops//
I think nmg knows camera things better than me...

But other cam-commands you can see here: Sequences <click<
edited 1×, last 18.07.09 09:56:32 pm

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
Amritsar has written
While I'm here... Why does this script make the unit have no collision?

colyr= collision y radius
colxr= collision x raidius
Just put two numbers in there and you will have a collision bounding box

old Re: Scripting Questions

The Second
User Off Offline

Quote
What are s2 cmd projectile script's modes? there is:
1
projectile item-typ,x,y,z, modus[,offset][,waffe]etc.

so what I should put on "modus"?
(and what each mode will do?)

Edit: And is there a way to attach same script to all objects?
edited 1×, last 18.07.09 12:15:25 pm

old Re: Scripting Questions

Hanoirose
User Off Offline

Quote
Someone told me to ask here: Would it be possible to make the stranded-guy fall asleep instead of bleeding when tired? It has always bothered me that when he gets tired he starts losing health...

old Re: Scripting Questions

Tau
User Off Offline

Quote
Impossible, as s2 cmd sleep doesn't work properly. But, as an option, you could set s2 cmd blur higher and higher, or add and increase the state "dizzy" so the player is forced to sleep sooner or later as orientation becomes impossible.
To the start Previous 1 268 69 70121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview