I have a basic build of the social.p script but i belive it may be missing a few lines of code or be slightly mixed up. As of this moment it works in Pleo and seems to perform as expected but i'll need confirmation. Heres the current script if anyone thinks they can tell if/where i may have miscoded, a full template will follow once i can confirm the validity of the code.
/////first working rebuild of social script, warning any mistakes may cause unwanted behaviour//
////// re-written by justbede
//////
/////
#include <Drive.inc>
#include <Property.inc>
#include <Log.inc>
#include "scripts.inc"
forward public social_init();
forward public social_eval();
forward public social_behavior_eval(behavior_id);
forward public social_exit();
forward public social_activate();
forward public social_deactivate();
social_init()//chngd
{
behavior_add(scr_wag, "social", 0, 100, 100, 100, 1000);
behavior_add(scr_whine, "social", 0, 100, 100, 100, 1000);
}
social_eval()
{
printf("Life Statistics: blood_sugar is %d, happiness is %d\n", get(property_blood_sugar), get(property_happiness)); return 50;
// By default, return a value of 50, so that
// the social drive wins most of the time.
}
social_behavior_eval(behavior_id)
// This function goes through each of the behaviors
// that are a part of this drive and selects one
// based on Pleo's happiness level.
//
{
switch (behavior_id)
{
case scr_whine:
{
if
(property_get(property_happiness) < 40)
{
return 50;
}
return 100;
}
default:
{
return 0;
}
}
}