English Scripting Questions

2,429 replies
Goto Page
To the start Previous 1 2 ... 110 111 112 ... 121 122 Next To the start
22.10.10 04:57:33 am
Up
aimeewilbury
User
Offline Off
I created a unit that has the vehicle behavior. Then I used the script that makes the transport monkey follow you around but instead of transporting things you ride the unit. However the unit stays in one place when you walk around

Is this due to the "vehicle" or did I likely screw up?
22.10.10 12:18:47 pm
Up
Hurri04
Super User
Offline Off
it's because of the vehicle behaviour, if you use the unit you automatically ride it. just set a different bahaviour which has no such functions.

put this script into the the unit's descripting file between the lines "script=start" and "script=end":
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
on:create {
     timer "self",3000,0;
}

on:start {
     timer "self",3000,0;
}

on:timer {
     if (health("self")>0){
          ai_mode "self","goto","unit","1";
          ai_center;
     }
     if (count_stored("self")>0){
          addstate "self","particles";
     }else{
          freestate "self","particles";
     }
}

this should make the unit follow you around.
23.10.10 11:39:01 pm
Up
aimeewilbury
User
Offline Off
Thanks
25.10.10 05:30:25 am
Up
Xaeveax
User
Offline Off
Is there a way to make the water transparent? I have seen it in a mod before, but don't know how to do it. Do you need to edit the actual water texture image and make that transparent or is it some sort of script?
25.10.10 03:29:16 pm
Up
Hurri04
Super User
Offline Off
you can use the command s2 cmd wateralpha to make the water transparent.
when using this command you have to set a value between 1 (not transparent) and 0 (completely transparent). I recommend using a value of 0.75 because this makes the best effect in my opinion.
also you have to use the command on:load because when changing the value of the wateralpha it wont be saved.

so the script for this would be:
Code:
1
2
3
on:load{
     wateralpha 0.75;
}

just write it into the global script of the map or into the game.inf file if you want the water to be transparent on all maps.
25.10.10 03:51:00 pm
Up
Xaeveax
User
Offline Off
Alright awesome it works!! Only problem is that for some reason coral (worst part to have thia issue!!) shows up crystal clear from above water, even if the alpha is 0.99. Everything else fades nicely exept this. You know the solution?
25.10.10 03:55:43 pm
Up
Hurri04
Super User
Offline Off
yes, I know about that problem, I think it is bacause of the stark contrast between the red color of the coral and the blue color of the water.
I don't think that there is any solution to prevent this...
25.10.10 04:03:50 pm
Up
Xaeveax
User
Offline Off
Hmmm ok. I guess I'll just make do. Thanks again!! Oh, And does this sort of code work with objects to? (obviously not wateralpha though.)
25.10.10 05:25:10 pm
Up
Hurri04
Super User
Offline Off
yes, there is the command s2 cmd alpha.
but there is a problem with it because it is a little bit bugged:
the text in the scripting definition says that it is possible to run this command at certain objects by using the parameters so you could write e.g.
Code:
1
alpha 0.75, "object", 1
this should give the object with ID 1 an alpha-value of 0.75.
you could write this script anywhere you like.

but this does not work because it is bugged and you therefore have to write the command into the object itself and trigger it by an s2 cmd event:

write this into the script which triggers that the object becomes transparent (normally into the global map script and on:load):
Code:
1
2
3
on:load {
     event "maketransparent", "global";
}

then you have to write this into the object(s) that are supposed to be transparent:
Code:
1
2
3
on:maketransparent {
     alpha 0.75;
}
26.10.10 05:37:05 am
Up
Xaeveax
User
Offline Off
Ok. I tried it and it seems to work. Do you know of any way that I could make it so that objects don't fade away when I walk farther from them? I noticed that several objects from Massive Mod don't fade, and was wondering how to do that.
26.10.10 04:50:43 pm
Up
Hurri04
Super User
Offline Off
yes, there is a way to edit the range at which the objects fade.

you have to edit the definition of every single object which is supposed to fade at another range than the standard of 500.

write this into the object's definition in its definition file:
Code:
1
autofade=500

instead of 500 just write a higher value, because 500 is the default value, as I already said.
if the object already has such a line just edit the value.

More >
27.10.10 01:21:31 pm
Up
Antonhel
User
Offline Off
I have a question, how do I use cameras??? They're quite confusing to me.. I even searched if this question already exists...
27.10.10 05:56:03 pm
Up
Hurri04
Super User
Offline Off
the most important commands for this are s2 cmd seqstart, s2 cmd movecam, s2 cmd setcam and s2 cmd seqend.
28.10.10 06:58:28 am
Up
Antonhel
User
Offline Off
Uh... I still don't know how to use cameras...can you give me an example script??
28.10.10 02:57:38 pm
Up
Hurri04
Super User
Offline Off
well, first you should set some infos on the map, you can use some of the flags, there are 4 or 5 colors of them. just set some to the waypoints of the way which the camera is supposed to move.

then the sequence has to start at some event, for instance on:hit of a tree.
so you have to write this into the tree (you might have to adapt this a little if you want to start the sequence at a different event):
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
on:hit {
     $flag01=[ID of the first waypoint(flag)];
     $flag02=[ID of the second waypoint];
     $flag03=[ID of the third waypoint];
     $flag04=[ID of the fourth waypoint];
     $flag05=[ID of the fifth waypoint];
     [...]
     $flag[XX]=[ID of waypoint #XX];

     seqstart;
     setcam 0, $flag01;
     movecam 0, 2000, $flag02;
     movecam 2000, 8000, $flag03;
     setcam 8000, $flag04;
     movecam 8000, 10000, $flag05;
     seqend 11000;
}

this is just a little example.
you can add more flags that the 5 I did and then repeat the line where you give the ID of the flag to the variable.

with this script the camera mode starts, then the camera moves from the first flag to the second flag within 2 seconds. next, the camera moves to the third flag within 6 seconds (difference between 2000 and 8000 = 6000 milliseconds).
then, when the camera has reached the third falg it jumps to the fourth flag, for instance to show a whole new area of the map.
then the camera moves to the fifth waypoint and stays there for one more second and then the sequence ends.

you can also try to use the command s2 cmd cammode e.g. to turn the camera sidewards to look at a certain object when it normally would go straight into one direction.
31.10.10 01:35:24 pm
Up
Xaeveax
User
Offline Off
Is there a way to make the texture detail of an object greater or lower? Meaning, change the amount of times the texture is repeated and make it look more detailed? I tried detailtex=blablabla but it didnt do anything...
31.10.10 02:50:10 pm
Up
Hurri04
Super User
Offline Off
no, there is no such command.
if you want the texture of the water to be repeated more often you have to edit the graphic whic is used as the texture.

you can find the graphic in the gfx folder, its name is "water.jpg".

what you could do is create a new image which is twice as high and twice as wide as the water.jpg and copy the water.jpg 4 times into this new picture.
but I dont know whether this really looks better...
31.10.10 03:47:19 pm
Up
pupp3tStudios
User
Offline Off
On this command: on:start{ freeze [unit Id] }; how do I unfreeze the specific unit? I tried the freeze script on myself, so I froze. But I don't know how to take the freeZe out.
31.10.10 07:01:54 pm
Up
Hurri04
Super User
Offline Off
Code:
1
freeze 1, 0;

this should unfreeze the player.
you can either write this script into the execute-script-box in the cheat-emenu or write it into a script with a fitting event to trigger it.

what makes the player unfreeze is the 0 at the end, to freeze the player you can write a 1 instead but you either can leave this away as you did.
31.10.10 11:56:34 pm
Up
pupp3tStudios
User
Offline Off
Alright thanks. I made a script that works as followed:
An enemy approaches and attacks me. As a result of his attack, I freeze to give the effect that I'm in the ground
Then, using a timer script, I "get out" of the ground. Heh weird
To the start Previous 1 2 ... 110 111 112 ... 121 122 Next To the start