Graalians

Graalians (https://www.graalians.com/forums/index.php)
-   Classic Future Improvements (https://www.graalians.com/forums/forumdisplay.php?f=26)
-   -   Pets (https://www.graalians.com/forums/showthread.php?t=1890)

R o s é 10-08-2011 11:40 PM

Quote:

Posted by LiamGRKelly (Post 17745)
perhaps a good pet would be like a bear that doubles as a horse and can defend you

lol /agreed

Pets in guild houses that can roam freely would be amazing.
(of course without walking aimlessly towards a fence, getting stuck in water, etc.)

Should have some sort of function to interact with them as well. ;) think about it!

Skill 11-08-2011 04:04 AM

Pets
 
Please make a pet system that allows players to have pets that follow them around. If scripted properly it will not lag, I have actually made the core for a pet system and it uses very little cpu on both clientside and serverside(following and "tricks" work, need to add polishes to the interface though)
basically with it you have all kinds of different looking pets that follow you and if you say something in chat they do a trick(change gani). Maybe make them able to be put in your house and wander around.





for scripters:
the spawned pets only take about 0.003% cpu time on serverside on a regular playerworld, due to a 0.3 second timeout with clientside interpolation of movement.
As for clientside lag it shouldn't lag, it uses no timeouts.

fp4 11-08-2011 04:24 AM

Post your pet system so I can criticize it, here's mine that I whipped up in the last 10 minutes to show insignificant you actually having the "core" scripts made is.

PHP Code:

function onCreated() {
  if (
this.owner) {
    
this.owner findplayer(this.owner);
    
this.owner.pet this;
  } else {
    
destroy();
  }  
  
initPet();
  
warptoOwner();
  
onTimeout();
}

function 
initPet() {
  
// Set's pet graphics and gani
}

function 
onTimeout() {
  if (
this.owner == NULL) {
    
// Owner no longer exists (logged off), so destroy.
    
destroy();
    return;
  }
  else if (
this.owner.level != this.level) {
    
warptoOwner();
    
setTimer(0.25);
  }
  else {
    
petLogic();
  }
}

function 
petLogic() {
  if (
getOwnerDist() > 4) {
    
moveToOwner();
  } else {
    
setTimer(0.5);
  }
}

function 
warptoOwner() {
  
// warpto this.owner
}

function 
moveToOwner() {
  
// determine delta angle/coordinates
  // move based on delta
  // set timeout based on movement length
}

public function 
performAction(action) {
  switch (
action) {
    case 
"dance":
      
setcharani("pet_dance"""); 
      break;
  }


Focus on the idea and not the fact you already have the "core" done if you actually want to see things get added in these forums.

callimuc 11-08-2011 03:01 PM

Quote:

Posted by fp4 (Post 30968)
nice stuff

Yay dancing petīs ^_^ well seems nice yet

iDylan 11-08-2011 03:04 PM

seems like a pretty good idea

Xavier 11-08-2011 03:46 PM

Great idea!


All times are GMT. The time now is 10:10 AM.

Powered by vBulletin/Copyright ©2000 - 2026, vBulletin Solutions Inc.