English Scripting Questions

2,429 replies
Goto Page
To the start Previous 1 2 ... 111 112 113 ... 121 122 Next To the start
01.11.10 12:06:02 am
Up
Hurri04
Super User
Offline Off
yeah, using a timer is a good choice for an event to trigger the command to unfreeze the player in this case.

I just wonder what kind of enemy could make you being stuck in the ground... maybe a mole...?
01.11.10 03:35:03 pm
Up
Xaeveax
User
Offline Off
I am trying to make it so that when I hit a drum model, it plays a drum sound. The script I have is..

script=start
     on:use {
          play "sfx/drumlow.mp3";
     }
script=end

Shouldn't that work? Or do I need something else?
01.11.10 04:11:13 pm
Up
Hurri04
Super User
Offline Off
I'm not sure but maybe you have to remove the "sfx/" because the sommand automatically starts in the sfx folder. though it might work the way you wrote it, I'm not sure, some commands require a path, some dont.

but if you want the script to let the sound play when you hit the drum you should write "on:hit" instead of "on:use". you maybe write some more lines to prevent the drum from getting destoryed.
Code:
1
2
3
4
5
6
7
8
9
10
11
12
on:start {
     local "$health";
     $health=health("self");
}

on:hit {
     $glob_health=health("self");
     $diff=$health-$glob_health;
     if($diff!=0) {
          heal "self", $diff;
     }
}


this should always repair the drum automatically when it is hit.
01.11.10 05:13:33 pm
Up
Volshebnyi
User
Offline Off
Can someone explain how to use var=?
For example:


Code:
1
2
3
4
5
6
var=my_var,Example,80,0;
script=start
on:hit{
     msg "My var: $my_var";
}
script=end


Message wiil be "My var: 0" instead of "My var: 80". But $my_var is now local variable.
01.11.10 08:20:10 pm
Up
Hurri04
Super User
Offline Off
I think you have to write this instead of the first line because normally variables start with a $ in S2:
Code:
1
var=$myvar, Example, 80, 0;


so with this command the object that has this script in its definition will have a box in the editor where you can set a variable to a certain value which normally is 80 (when not editing it). the text to the left of the box will be "Expample" (without the quotation marks) and it is a local variable because of the 0 at the end.
01.11.10 10:23:59 pm
Up
Volshebnyi
User
Offline Off
Hurri04, thanks! I was confused because MassiveMod var declarations are without "$".
Code:
1
var=water,Water,0,0
01.11.10 10:32:03 pm
Up
Hurri04
Super User
Offline Off
I'm not sure but if it helps you then it's fine
04.11.10 01:57:18 am
Up
Vicrry
User
Offline Off
Is is possible to create an object with randomcreate() and drop a map marker at the spot the game found? I'd like to make a map that has similar features but is still different whenever it is generated.
04.11.10 05:22:39 pm
Up
Hurri04
Super User
Offline Off
Code:
1
2
3
4
5
6
7
8
9
10
on:start {
     $m_id=randomcreate("object", [TYPE OF THE OBJECT]);
     $m_x=getx("object", $m_id);
     $m_z=getz("object", $m_id);

     $marker_id=create("info", 36, $m_x, $m_z);
     showindicator $marker_id;
     setindicatorlook $marker_id, [VALUE BETWEEN 1 AND 4];
     setindicatorinfo $marker_id, "[TITLE OF THE INDICATOR ON THE MAP]";
}

this should do the job.
05.11.10 12:12:19 pm
Up
Xaeveax
User
Offline Off
I guess this is sort of (not really) related, but is there a script or something in the game.inf for the randomly placing objects in map editor? Can you pick which things are placed and how frequently?
05.11.10 04:45:41 pm
Up
Hurri04
Super User
Offline Off
I'm not sure but I think the game takes some values of how many of which objects in which hight shall be created from the files of the random islands:
random_01_endless_e.inf
random_02_endless_n.inf
random_03_endless_h.inf
09.11.10 06:34:48 am
Up
aimeewilbury
User
Offline Off
How do I make it so when the player drinks a bottle of water it returns an empty bottle?
09.11.10 04:48:27 pm
Up
Hurri04
Super User
Offline Off
write this into the definition script of the bottle of water:
Code:
1
2
3
4
5
on:eat {
          process "Drinking",1000;
          drink 5,0,50,0;
          find [TYPE OF EMPTY BOTTLE];
     }

in fact, the first and the second command line already are in the definition script of the bottle of water so all you need to do is to add the line with the s2 cmd find command.
you can get the type-number by hovering the mouse over the icon of the empty bottle in the editor.
13.11.10 08:09:31 pm
Up
pupp3tStudios
User
Offline Off
Is there a way to change the time of day fast?
For example, through a trigger or something, can i make it turn to nighttime even when it's during the day?
13.11.10 10:11:11 pm
Up
Hurri04
Super User
Offline Off
you could set the ingame hour to an other value using the commands s2 cmd hour and s2 cmd sethour and also the commands s2 cmd minute and s2 cmd setminute and, if necessary s2 cmd day and s2 cmd setday.

you could start a map where you just stand there for a while, like 10 minutes real-time which you clock on your watch or something and then you open the character menu to have a look at the day, open the inventory and use a watch to get the hours and minutes.
then you have to figure out how long one minute ingame is in real-time.
(I recommend to clock a very accurate value and use a map that you created in the editor, with an arcade-info on it so you wont get hungry/thirsty/tired while you wait, and you can also give yourself a watch to clock the hour and minute!)

next you can use the command s2 cmd timer and trigger an event every few seconds (the amount of seconds one ingame minute takes minus a certain factor to make the ingame minutes have less seconds which the player cant prove because he cant check the seconds ingame).

using this you can skip an ingame minute from 60 ingame-seconds (which are less than 60 real-time-seconds!) to a lower amount, just set the current minute +1, or if the current minute is 59 set it to 0 and set the current hour +1 (same with days).

so if you'd skip half of the minutes a day also would last half as long. the sun should automatically rise faster because it is connected to the current time that is.

at least I think that is how it should work, havent tested it myself yet but I'm pretty sure it will work
18.11.10 09:30:52 am
Up
jessetheduck
User
Offline Off
I wrote my own script's but they will only work on random island with the people I make. I go to list click on the native and paste this script in is something wrong? I'll paste it here. I haven't completed it ive just tried to test it.
page=start
title=Grandpa
text=start
Hey you. How's it going?
text=end
button=trade,I want to trade.
button=action:close,Don't bother me!
button=info,Could you tell me something?

page=trade
title=Trade with grandpa
### Hempleaf -> Cookie
trade=start
sell=83,5
buy=66,1
trade=end
### Hempleaf -> Trunk
trade=start
sell=83,10
buy=7,1
trade=end
### Hempleaf -> Grapes
trade=start
sell=83,15
buy=45,3
trade=end
### Hempleaf -> Grain Pile
trade=start
sell=83,15
buy=42,3
trade=end
### Hempleaf -> Plums
trade=start
sell=83,15
buy=116,3
trade=end
### Hempleaf -> Coconut
trade=start
sell=83,20
buy=27,3
trade=end
### Hempleaf -> Banana
trade=start
sell=83,20
buy=14,3
trade=end
### Hempleaf -> Cacao Fruit
trade=start
sell=83,25
buy=67,3
trade=end
### Hempleaf -> Coffee Fruits
trade=start
sell=83,25
buy=70,3
trade=end
button=action:close,Cheers!

Page=info
title=Grandpa
text=I'll spare some info what do you want to know?
text=end
button:weapons
button:action:close, No thanks. Bye!

Page=weapons
title=Grandpa
text=I know a bit about weapons so I'll tell you how to make some good ones.
text=end
button:Spears
button:Bow
button:Ammo
button:action:close, No thanks I'll just experiment.

Page:Spears
title=Grandpa
text=I know two types of spears the normal spear whitch is simply made with a branch+stone and the claw spear which bleads the victim to death made by claws+branch
18.11.10 12:56:03 pm
Up
DannyDeth
User
Offline Off
"Page:Spears" is really wrong. it is suposed to be
Code:
1
page=Spears


Otherwise eveyrhint looks cool

EDIT: A whole lotta that code is wrong actually.

Replace all the ":"'s with "="'s otherwise your code wont work correctly!
18.11.10 03:27:30 pm
Up
Hurri04
Super User
Offline Off
there is another problem:
this is the code you have to use for dialogues, you cant simply write it into the normal scriptbox of a unit.

the code you wrote there goes into a text container (which you can find at the infos) and then you have to look up and remember the ID of that text container (click on the text container again, you can find it at the top) because you will need it in the script that actually goes into the scriptbox of the unit:
Code:
1
2
3
on:use {
     dialogue "start", "[WRITE THE ID OF THE TEXT CONTAINER HERE, WITHOUT THE BRACKETS]";
}
21.11.10 02:45:10 pm
Up
Xaeveax
User
Offline Off
This is probably an easy one, but what would be the definition for the rate at which a unit attacks. I have a unit that attacks at a rate that is way faster than i want it to. Is there a definition to make it slower? I tried rate (like the item one) but it doesn't work on units.

Edit- Also, is there a way to make it that when I use attack2, it uses a different kind of behavior? for example, using a melee attack with a pistol?
edited 1×, last 22.11.10 09:50:36 am
23.11.10 02:38:50 pm
Up
amstel bier9
User
Offline Off
can someone help me?
i want that if i drop item X that you get a timer and when the time is over Item X dissapear.
thanks already
current project: seasons survivor! done: GTA lienden! done: Ultimate Survival!
To the start Previous 1 2 ... 111 112 113 ... 121 122 Next To the start