PDA

View Full Version : new (weird) idea


Inguz
06-10-2001, 08:07 PM
is it possible to make a NPC that makes the player like
sleepy hungry and dirty
if so can someone post the script
ohh and it would be great if it could be noticed by other players

KJS
06-10-2001, 09:39 PM
yes it is possible

but like
I am not going to make the code (usually when I show people coding on the forum I do it all off the top of my head)

well it deals with some flags
ie
client.sleep=100

and you could have something like 100 = full sleepness.

and like if they are at 100 then they can't walk and just start to sleep on the ground.. (you would have to make your own sleep gani because the sleep gani only shows the head)

Tyhm
06-11-2001, 04:35 AM
if(playerenters) toweapons -System;
if(isweapon||timeout){
if(strequals(#m,sleep)){
setstring sleepy,#v(strtofloat(#s(sleepy))-1);
}else{
setstring sleepy,#v(strtofloat(#s(sleepy))+0.01);
}
if(playerswimming){
setstring dirty,#v(strtofloat(#s(dirty))-1);
}else{
setstring dirty,#v(strtofloat(#s(dirty))+0.01);
}
setstring hungry,#v(strtofloat(#s(dirty))+0.01);
//insert what effect these strings have here
timeout=0.05;
}

Then for all food items, setstring hungry,#v(strtofloat(#s(hungry))-10); or so.

Note: It is possible under this system to stockpile cleanliness and sleep and food...not necessarily a bad thing, but you probably want to put SOME limits on how negative hungry and dirty and sleepy can be.

Inguz
06-11-2001, 10:25 AM
thats great but there is a problem with that script the player would be constantly Sleeping hungry and Dirty
whats the timer command

Speedoflight14
06-12-2001, 10:02 AM
what about make it with day/night script?

KJS
06-12-2001, 10:05 AM
you could make the timeout longer...


like
insted of
timeout=0.05

but like

timeout=5

Speedoflight14
06-12-2001, 10:08 AM
what about it random?

KJS
06-12-2001, 10:24 AM
that wouldn't be hard to program in also
if(playerenters) toweapons -System;
if(isweapon||timeout){
tmprand = random (0.01,0.1)
if(strequals(#m,sleep))
setstring sleepy,#v(strtofloat(#s(sleepy))-1);
else
setstring sleepy,#v(strtofloat(#s(sleepy))+tmprand );
if(playerswimming)
setstring dirty,#v(strtofloat(#s(dirty))-1);
else
setstring dirty,#v(strtofloat(#s(dirty))+tmprand );
setstring hungry,#v(strtofloat(#s(dirty))+tmprand );
//insert what effect these strings have here
timeout=0.05;
}