Forum

> > Stranded II > Scripts > need script to need to feed carrier monkeys
Forums overviewStranded II overview Scripts overviewLog in to reply

English need script to need to feed carrier monkeys

6 replies
To the start Previous 1 Next To the start

old Re: need script to need to feed carrier monkeys

Hurri04
Super User Off Offline

Quote
I dont mean to be rude but I'd like to ask you to hold up a second with creating a new thread for every single idea you have of what could possibly be implemented in S2.

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
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

old Re: need script to need to feed carrier monkeys

monkeypal
User Off Offline

Quote
first of all i dont imply the demanding voice its my normal way to speek and second im asking for ideas as i have seen some things you have done actually and i know you have more experience with this than i would. im mainly asking how i should set it up

old Re: need script to need to feed carrier monkeys

Hurri04
Super User Off Offline

Quote
well first of all if you want the monkey to get hungry you'll need a way to show the player how full he currently is since the monkey cant talk to the player and say "hey I'm hungry".

one option would be to use info sprites: s2 cmd create such an info node at the monkey's location and give it the image of a green bar using s2 cmd 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 s2 cmd timer to update the position of the info to that of the monkey (s2 cmd 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 s2 cmd hour and s2 cmd 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 s2 cmd addstate. control the speed with the s2 cmd 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 s2 cmd freestate.

further you could limit the range at which the player sees the image by checking s2 cmd 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.

old Re: need script to need to feed carrier monkeys

monkeypal
User Off Offline

Quote
thanks but i would like to start easy as i have no experience with unit scripts so first i will try and create the sprites to show the player his hunger

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
//~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

old Re: need script to need to feed carrier monkeys

Hurri04
Super User Off Offline

Quote
this just means that you are looking at the wrong file. what you see there is just some dialogue that is already present in the game. it is being displayed when you talk to a trained carrier monkey with 'E' to give him tasks.

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 s2 cmd 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.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewStranded II overviewForums overview