Forum
Stranded II Scripts need script to need to feed carrier monkeysneed script to need to feed carrier monkeys
6 replies 1
from what I've seen in the last few days you've already created quite a lot of new threads in which you just drop a one-liner in the OP and some of them do have the tone of "here's my idea now do everything for me".
sadly, the days of high activity in the S2 section are long gone and while you still might find a few people who can help you with you problems I'd imagine they'll grow a bit tired of your commanding tone soon as well.
the general idea is that you should try to work on some scripts on your own. if it then doesnt work and you are really stuck you can post it here using the [ code ] and [/code ] tags to make a nice box:
1
2
3
2
3
on:start { 	msg "Hello world!"; }
this shows people that you have already put some effort into the problem yourself and they are more likely to help you. also remember of course to give a good explanation on what the problem is. from what I hear there were a few users who had a crystal ball to magically see the problem but apparently some of those broke, got stolen or the users are just too lazy to dust them
one option would be to use info sprites: create such an info node at the monkey's location and give it the image of a green bar using info_sprite to show to show that he has no hunger. afterwards exchange the image with another one that is partially filled red to show that the monkey is hungry.
you'll need a few images like that to cover multiple stages. while the player has 100 hunger "points" I think e.g. 10 points for a monkey would suffice. you can match this internally by giving the monkey a variable which saves the current state. another variable is needed to save the ID of the info sprite which belongs to the monkey.
next you'll need a fast timer to update the position of the info to that of the monkey ( setpos). you'll have to experiment a bit here: 1 second might look a bit laggy when the monkey is following you but you probably shoulnt go (much) below 0.5 seconds.
then you'll need a slower timer (maybe 120-180 seconds) which lets the monkey's hunger rise with each tick.
if you want to prevent that the monkey's hunger doesnt go up while the player sleeps you can check hour and minute before and after the player sleeps, calculate the difference and the resulting hunger points and add them to the monkey's current hunger.
remember to let both timers run only locally on the monkey to vastly save performance and make it posible to have independent values for individual monkeys.
high hunger could result in the monkey running slower which should be doable by giving the monkey the "speedmod" state via addstate. control the speed with the statevalue command.
full hunger could finally result in the monkey running away and thus becoming untrained again as he tries to find food on his own again. use freestate.
further you could limit the range at which the player sees the image by checking inrange so he doesnt "magically know" the hunger of the monkey.
if you are unsure where to start then beginn with the easy stuff so you can post some results of your own when you get stuck or are unsure about the efficiency of certain scripts.
i opened the stranded ll/mods/sys/monkey not train monkey but just monkey this is what i get
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
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
//~start Uhh uh ahh ah ahh! Ahh ah... Uhh uh uh .. aahhh aahh uh! Ugh! Ahh ahh! Ahh ugh ahh ahh, uhh uh? Hmmm... Lucky thing I speak monkey tongue! The monkey greets me and asks what he can do for me. //~alreadygotjob Ahhh ahhh ah! Ugh ah! Ugh ah! Uh uh uh uh! The monkey already has a job. I must wait for him to finish it before I can give him new orders! //~order_water setlocal $menuclass,$menuid,"order",1; play "monkey_idle1.wav"; closemenu; //~order_branch setlocal $menuclass,$menuid,"order",2; play "monkey_idle1.wav"; closemenu; //~order_leaf setlocal $menuclass,$menuid,"order",3; play "monkey_idle1.wav"; closemenu; //~order_stone setlocal $menuclass,$menuid,"order",4; play "monkey_idle1.wav"; closemenu; //~order_food setlocal $menuclass,$menuid,"order",5; play "monkey_idle1.wav"; closemenu;
what does this mean can we talk to regular monkeys or is dc planing to do this in slll
i do not know what to use the monkey SCRIPT i just showed you or the carrier monkey unit in sys/units
the file you need to look at is the units.inf file in the sys folder (NOT the scripts folder in the sys folder). the normal monkey can be found at lines 701-784 and the carrier monkey at lines 1292-1342.
I suggest you use the normal monkey though.
if you want to work on the part where the player can feed a banana to the monkey you'll need to look at the items_edible.inf file at lines 143ff. you can write a new on:attack2 event there so the monkey can be fed via RMB when the player has a banana in his hand. just remember to make an extra if branch at the on:use part of the monkey to check whether the player has a banana in his hand. if yes then the monkey will be fed. if not then the normal dialogue will show.
1