English Scripting Questions

2,429 replies
Goto Page
To the start Previous 1 2 ... 115 116 117 ... 121 122 Next To the start
29.12.10 04:45:21 pm
Up
Xaeveax
User
Offline Off
Anybody know how to get rid of the annoying "second unit" for vehicles. Meaning, all vehicles are always outlines with a lower alpha version of themselves and I have no clue how to get rid of that. Is it possible?
29.12.10 08:58:00 pm
Up
Dr Zhark
User
Offline Off
Jesterhead37 has written:
Anybody know how to get rid of the annoying "second unit" for vehicles. Meaning, all vehicles are always outlines with a lower alpha version of themselves and I have no clue how to get rid of that. Is it possible?


Either turn debug mode off, or you can't because it is hard coded.
31.12.10 09:52:17 am
Up
amstel bier9
User
Offline Off
can someone fix this?
i want that the state "tame" is not forever but only some seconds..

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
on:impact {
          process "expelliarmus",1000;
          msg "expelliarmus!",4;
          $tmp=impact_class();
          $tmp2=impact_id();
          addstate $tmp,$tmp2,"tame";
          statevalue $tmp,$tmp2,"tame",18;
          timer"$tmp",$tmp2,2000,1,"timer";

          }
     on:timer {
          freestate $tmp,$tmp2,"tame";
          statevalue $tmp,$tmp2,"tame",18;
     }

already thanks
current project: seasons survivor! done: GTA lienden! done: Ultimate Survival!
31.12.10 10:29:53 am
Up
Xaeveax
User
Offline Off
Just set it up so that when ever the thing is tamed, it sets off a timer. When the timer is finished, set it so the tame goes away.
31.12.10 12:01:15 pm
Up
Vectarrio
User
Offline Off
Ok, people, I have a question:
I have a cube, and I use it. How to know, what side of it was used? I know about use_x e.t.c. but my algorhytm was buggy. So I need your help.
31.12.10 03:27:05 pm
Up
Hurri04
Super User
Offline Off
working on a minecraft mod?

well, actually there is no way in Stranded 2 to know which side of the cube was used by a simple command.

but if I got it right there are 2 different ways to do it:

• make all the sides of the cube be different objects. you can also add scripts to the different parts so that e.g. on:edset one of the parts is set in the editor the other parts are automatically created and placed correctly.
when using this method you'd know which side was used pretty easy.

• or you make a cube be one single object. but then you have to do some math, calculation of angles and rotations and stuff.
so when using a cube you have to get the players rotation and the rotation of the cube and then you have to add or abstract them. then you have to make a large if-query for all the diffenrent angles from -360° to + 360° in 90° steps so you actually go around one full circle for two times. but the first and the last step have to be 45° steps so you start from -360° to -315° then -315° to -225° then -225° to -135° and so on and you have to give all the 4 different possibilities numbers to which a variable is set so th efront side is 0, the right side is 1, the back side is 2 and the left side is 3.
but by this you wont take the top side and the bottom side into account. to accomplish this you'd have to do the same as before but this time for the vertical angle.
so you see this is MUCH more work and I therefore suggest using the first solution.
01.01.11 01:49:31 am
Up
UnIdEnTiFiEd
User
Offline Off
Hurri04 has written:
or you make a cube be one single object. but then you have to do some math


thats what calculators are for!

I have a question, how do i make a unit with the 'shy' behaviour, shoot projectiles when close enough, and how do i choose its speed, drag, and what the projectiles is?
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
01.01.11 01:03:46 pm
Up
Xaeveax
User
Offline Off
Quote:
I have a question, how do i make a unit with the 'shy' behaviour, shoot projectiles when close enough, and how do i choose its speed, drag, and what the projectiles is?


I may have a solution. I used it for an object though, so it MAY not work with units. I would imagine it will though... Just put it in the script. I don't think that the "shy" behavior will affect it.
Spoiler >

Hope that helps!! (Thanks to hurri04 for teaching me)

Edit- I also have two questions.

1. Does anybody know how to make the combination generation a choice of multiple options? So that you can build something and get multiple possible results?

2. Is there a way to edit a savegame map? Meaning, if someone plays and then saves, edit the map with all the stuff they saved? I need to be able to edit the map with all the changes that a player has made to it's original shape (things he built/killed etc...)
edited 1×, last 01.01.11 02:19:23 pm
01.01.11 03:10:49 pm
Up
dsm1891
User
Offline Off
to ^,


theres a random generator in the colour game. look look @ the script=]


also, is there a way of ending a game when you use a oblject, e.g. use a boat -game ends
01.01.11 04:19:37 pm
Up
Xaeveax
User
Offline Off
Thanks for the help, but I already knew that one. I was looking for one that works with combinations, when you build things. Thanks for trying though!
01.01.11 07:26:19 pm
Up
Hurri04
Super User
Offline Off
Jesterhead37 has written:
Code:
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
script=start
     on:start {
          local "$x", "$y", "$z";
          $x=getx("self");
          $y=gety("self");
          $z=getz("self");
          $y+=28;
          timer "self", 3000, 0;
     }
     on:create {
          local "$x", "$y", "$z";
          $x=getx("self");
          $y=gety("self");
          $z=getz("self");
          $y+=28;
          timer "self", 3000, 0;
     }
     on:build_finish {
          local "$x", "$y", "$z";
          $x=getx("self");
          $y=gety("self");
          $z=getz("self");
          $y+=28;
          timer "self", 3000, 0;
     }
     on:timer {
     if(playerdistance("self")<500) {
          projectile 54, $x, $y, $z, 4, 30, 15, 59;
          }
     }

well, as I was the one who wrote this script I think I should give you some hints
this script works fine for objects because they dont move.
but as units move this script wont work correctly anymore.

the "on:building_finish" event has to be changed to "on:spawn" and the commands to get the position of the unit have to be moved to the "on:timer" event.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
script=start
     on:start {
          local "$x", "$y", "$z";
          timer "self", 3000, 0;
     }
     on:create {
          local "$x", "$y", "$z";
          timer "self", 3000, 0;
     }
     on:spawn {
          local "$x", "$y", "$z";
          timer "self", 3000, 0;
     }
     on:timer {
          $x=getx("self");
          $y=gety("self");
          $z=getz("self");
          $y+=28;
          if(playerdistance("self")<500) {
               projectile 54, $x, $y, $z, 4, 30, 15, 59;
          }
     }
script=end

so this now is the complete definition script for that unit.
02.01.11 05:13:08 am
Up
Xaeveax
User
Offline Off
Ah right. Thanks! Well, now he's got the right script.

-So. Two questions. One, the same one about editing a saved game. Two, is there a way to make fishing rods catch fish deeper? If fish are too deep it doesn't let me catch them.
edited 1×, last 04.01.11 07:05:04 am
04.01.11 01:23:34 pm
Up
Hurri04
Super User
Offline Off
1) no you apparently cant open a save file in the editor. I just tested it. (btw you simply could have found that out by testing it yourself )

2) I hope you know that there dont even need to be fish to catch any with the fishing rod?
all there needs to be is a fishing spot which you can set in the editor. you will find it at the infos.
if you place any fish in the water and then try to catch them it of course wont work like that because when fishing (and succeding) a new fish-item simply is spawned, it has no effect on the fish that are in the water.
04.01.11 03:06:50 pm
Up
Xaeveax
User
Offline Off
1. Yeah, I was just seeing if there were any sort of funky converter things out there, but guess not.

2. Yeah I know. I've made it so that you can only catch fish where there are fish, and I've added at least 25 different types of catchable fish (as opposed to the boring green creepy one) so I wanted to know if I could give the rod some sort of range. And actually, it does affect the fish in the water. Just set it that on:fish { free "self"; though, I'm not sure if that is set in the standard game... Anyways, least I know it can't be done now. Thanks!
04.01.11 10:35:34 pm
Up
pupp3tStudios
User
Offline Off
I gots a question:
I have an item, the "Grappler", that I am testing for Pupp3t Mod. ScenArio:
You are surrounded by enemies, and the Grappler is in your hand. You shoot it( with a projectile coming out), the projectile hits a wall in the distance, and you're at the exact same spot where the projectile hit the wall.
How can I do this? Can someone help me?
04.01.11 11:21:37 pm
Up
Hurri04
Super User
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
script=start
on:attack1 {
     $scanrange=[RANGE];
     $target=scantarget($scanrange);
     $targetx=targetx();
     $targety=targety();
     $targetz=targetz();

     $targetx-=20;
     $targetx+=20;
     $targetz-=20;

     setpos "unit", 1, $targetx, $targety, $targetz;
}
script=end


I think this should be it.
edited 1×, last 04.01.11 11:51:38 pm
05.01.11 12:41:52 am
Up
pupp3tStudios
User
Offline Off
Mm.. Something like that.
Instead of "attack1", I'll use "Impact".
Thanks tho
05.01.11 01:11:14 am
Up
Hurri04
Super User
Offline Off
well, if you are using a projectile you can also use this script:
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
script=start
on:impact {
     $impactx=impact_x();
     $impacty=impact_y();
     $impactz=impact_z();

     $impactx-=20;
     $impacty+=20;
     $impactz-=20;

     setpos "unit", 1, $targetx, $targety, $targetz;
}
script=end

I think this script might be better when using a projectile because the pojectile has some drag and stuff so it goes down after a distance and this script here supports this other than the script I postet before which was good if there was no projectile so it would teleport you to the place where the crosshair was pointing unless that wasnt within the radius you had to enter in the script.
05.01.11 08:32:00 pm
Up
Dr Zhark
User
Offline Off
I can't figure out how to make another Unit activate an unactivated marking on the map. Any help? If you could, I give you lots and lots of cookies.
05.01.11 08:39:52 pm
Up
Hurri04
Super User
Offline Off
I'm not exactly sure what you mean but I guess you are looking for this command: s2 cmd showindicator.
but as you didnt post your script I cant really tell where you have to write it.
To the start Previous 1 2 ... 115 116 117 ... 121 122 Next To the start