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 233 34 35121 122 Next To the start

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
Um... Idts... When you use on:selectplace { it means when you select a place for a building... What builder said was actually determained by camera executions. well, anyways...
How do you stop the player from saving?

old Re: Scripting Questions

Builder2-0
User Off Offline

Quote
Bloodshot has written
Um... Idts... When you use on:selectplace { it means when you select a place for a building... What builder said was actually determained by camera executions. well, anyways...
How do you stop the player from saving?

Except we were not talking about the EVENT "selectplace", we were talking about the *command* selectplace. There is a large difference there. Honestly guys, if you don't know what something does, the best thing to do is at least figure out the proper syntax, and then just mess around with it.

-Builder

old Re: Scripting Questions

Gloppy
User Off Offline

Quote
Started to script today (read the tuts) an Ive got a problem:
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
35
36
37
38
39
40
41
42
43
44
45
46
### Calculator Tree 1
id=224
name=Palm
group=palm
icon=gfx\palm01.bmp
model=gfx\palm01.b3d
swayspeed=12
swaypower=12
fx=16
scale=2.3
mat=wood
health=900
find=15,15,3
behaviour=tree
healthchange=15
script=start
    on:hit {
            $calctree1++;  
    msg "$calctree1  +  $calctree2  =  $calctree1+=$calctree2";
          }
         
script=end



### Calculator Tree 2
id=225
name=Palm
group=palm
icon=gfx\palm01.bmp
model=gfx\palm01.b3d
swayspeed=12
swaypower=12
fx=16
scale=2.3
mat=wood
health=300
find=15,15,3
behaviour=tree
healthchange=15
script=start
    on:hit {
            $calctree2++;  
    msg "$calctree1  +  $calctree2  =  $calctree1+=$calctree2";
          }
script=end
And in the message box is: 6 + 9 = 6+=9
So what went wrong?

old Re: Scripting Questions

dragoana
User Off Offline

Quote
Save the result in a variable:
1
2
3
4
5
on:hit {
$calctree1++;
$calctree3=$calctree1 + $calctree2;
msg "$calctree1 + $calctree2 = $calctree3";
}

old Re: Scripting Questions

HudaJan
Super User Off Offline

Quote
This is question probably only for DC, because he knows all the options of the game (I think )
Is it possible to make player input something, for example his name, or some number, and it'd be saved to variable or something...??

old Re: Scripting Questions

bezmolvie
User Off Offline

Quote
I don't think so, but I wish there was. It would be crucial in multiplayer which probobly isn't coming anyways...

old Re: Scripting Questions

Builder2-0
User Off Offline

Quote
Schnapsidee has written
s2 cmd inputwin
This command returns an entry of the Player.
But I can't translate the description or write an example.

Gah, was going to say that but I was running late on time. I just *barely* got into the theatre in time, the previews were just finishing up, and the Dark Knight starting. I was like "HOLY SHIT OMFG".

But yea, that command should do what you want. And Bloodshot, there already is a "chat" command in-game, I found it accidentally in the editor. It was some obscure key.

Give me a couple of minutes to test the inputwin command, I'll see if I can debug it enough to figure out how to use it properly.

That way players will be able to write stuff, which is another thing I've been planning to do.

EDIT: Got it.
At first I thought the "text" variable was the name of the variable it would create, so I messed around with trying to debug that with my ghetto debug system (aka, msg command). After my first test I realized that was the TITLE of the "window", and quickly thought that perhaps the message was written in the BUFFER. So I found a command that writes a message directly from the buffer, and lo and behold there was nothing there.

So now I was really fucking confused, but I realized something. Decisionwin and other commands don't write to the buffer, nor do they create a variable. They are used to DEFINE a variable.

I quickly tested this simple script:
$text = inputwin();
msg "$text";

Much to my surprise it worked. I've tried for maybe 15 minutes now trying to get the damn script to work with different versions, such as:

$text = inputwin "text",3();

Or:

$text = (inputwin "text",3());

But it just won't work. So for now I guess if you want the player to be able to write something, they will have to settle for a window without a title.

-Builder
edited 1×, last 19.07.08 02:11:25 am

old Re: Scripting Questions

garfield751
User Off Offline

Quote
i need alittle help with this script

1
2
3
on:trigger { 
	  diary "Rock" ,"???"; 
	  }

im useing it with a area trigger and it shows the entry but it wont stop poping up

old Re: Scripting Questions

Builder2-0
User Off Offline

Quote
garfield751 has written
i need alittle help with this script

1
2
3
on:trigger { 
	  diary "Rock" ,"???"; 
	  }

im useing it with a area trigger and it shows the entry but it wont stop poping up

There is probably a better way to do this, but I don't have time to mess around and find out how... Make a variable like "$visited" and attach that to the script. Then make it so:
1
2
3
4
5
6
on:trigger { 
		if ($visited = 0) {
	 		diary "Rock" ,"???"; 
			$visited = 1;
		}
	  }
Then send me 5$ dollars via Paypal if it works. What should happen is you enter the area, you have not been there before, the diary opens, and it says YOU HAVE BEEN THERE. Then next time it tries to run it cannot because "you have been there" is 1.

Btw, don't do anything stupid. Make sure the variable IS NOT DECLARED ANYWHERE A RE-DECLARATION OCCURS EACH TIME THE SCRIPT IS RUN. Aka, make sure that the variable is *not* reset to the 0 when the area trigger goes off, otherwise this will not work at all.

-Builder

old Re: Scripting Questions

garfield751
User Off Offline

Quote
erm.... thanks for your help builder but i figured it out after i rooted thorugh the adventure files for the first island and all i needed to add was
1
free "self"

old Re: Scripting Questions

Builder2-0
User Off Offline

Quote
garfield751 has written
erm.... thanks for your help builder but i figured it out after i rooted thorugh the adventure files for the first island and all i needed to add was
1
free "self"

Ah, that was the "simple" way I was talking about. *shrug* Forgot about that, heh, it removes the area trigger completely.

-Builder

old Re: Scripting Questions

HudaJan
Super User Off Offline

Quote
Schnapsidee has written
s2 cmd inputwin
This command returns an entry of the Player.
But I can't translate the description or write an example.

Thanks. I won't drink vodka anymore, I'll drink only Schnaps
Builder, thanks too IMG:https://www.unrealsoftware.de/img/cookie.gif
IMG:https://www.unrealsoftware.de/img/cookie.gif

old Re: Scripting Questions

dragoana
User Off Offline

Quote
Builder2-0 has written
So for now I guess if you want the player to be able to write something, they will have to settle for a window without a title.

I finally got it working!

$name = inputwin("Enter your Name",1);
if($name==0) { $name="unknown"; }
msgbox $name, "Hello, my name is $name";

@Gloppy: keine Ursache

old Re: Scripting Questions

HudaJan
Super User Off Offline

Quote
Shit, I've just figured this out, but you was faster!!
Ok, I'm going to drink vodka again
Edit: But I still don't know what are "cancel","okay" commands for...... I'll keep trying:)
Edit 2: I found out.. it disappointed me a little.. It's just title of cancel, okay buttons...
edited 2×, last 19.07.08 04:53:53 pm

old Re: Scripting Questions

HudaJan
Super User Off Offline

Quote
yes, there is, but it won't work properly, because levelup events are activated only when you "walk through" all of the skillpoints one by one
s2 cmd incskill
To the start Previous 1 233 34 35121 122 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview