Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   new (weird) idea (https://forums.graalonline.com/forums/showthread.php?t=4476)

Inguz 06-10-2001 07:07 PM

new (weird) idea
 
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 08:39 PM

yes it is
 
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 03: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 09: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 09:02 AM

what about make it with day/night script?

KJS 06-12-2001 09:05 AM

or you could
 
you could make the timeout longer...


like
insted of
timeout=0.05

but like

timeout=5

Speedoflight14 06-12-2001 09:08 AM

what about it random?

KJS 06-12-2001 09:24 AM

that wouldn't be hard to program in also
 
that wouldn't be hard to program in also
NPC Code:
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;
}



All times are GMT +2. The time now is 07:26 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.