PenUltima Online Forum Index Official Core: 096.7
Official Core: 097 2008-02-26
Donate towards the POL web hosting bill!
 POL Home   FAQ   Search    Memberlist   Usergroups    Register    Profile   Log in to check your private messages   Log in
Healing Command
Goto page Previous  1, 2
 
Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help (095)
Display posts from previous:   

Author Message
Damien



Joined: 15 Apr 2006
Posts: 65

PostPosted: Tue Jun 27, 2006 4:15 am    Post subject: Reply with quote

Yeah Thanks.

What i did was that i copied Healing.src and renamed the copied one to use_bandages and now it works :]

BUT when i heal myself i get this thing standing:

<appobj:ScriptExRef>
Damien is healing Damien using <--- and here it ends but i can fix that myself.

But my question is: Whats this: <appobj:ScriptExRef> :O and how can i do so its not showing everytime i heal myself? :O

And was it right to copy Healing.src and rename it to use_bandages or is it an easier way?

But im just Glad if this: <appobj:ScriptExRef> dissapears Very Happy

Thanks i reallllly appreciate it.

Author Message
OldnGrey



Joined: 04 Feb 2006
Posts: 520

PostPosted: Tue Jun 27, 2006 4:22 am    Post subject: Reply with quote

Look above where is says:
SendSysMessage(who, who.name + " is healing " ...............

There will be another SendSysMessage line before that somewhere. That is trying to print a reference which it can't print.

Author Message
Damien



Joined: 15 Apr 2006
Posts: 65

PostPosted: Tue Jun 27, 2006 4:31 am    Post subject: Reply with quote

I just discovered something new :O

If i click Esc while selecting a target i get this error:

<appobj:ScriptExRef>
Damien is healing error errortext =
"Object does not support members" using
who would you like to heal?
Cancelled.


Soo look here:

Code:

program use_bandages(who, item)
var patient;
   if (!item)
     item := who[2];
     patient := who[3];
     who := who[1];
   endif
SendSysMessage(who, who.name + " is healing " + patient.name + " using bandages" );
   healing := GetAttribute(who, "healing");
   Anatomy := GetAttribute(who, "anatomy");
   EraseObjProperty(who, "IsMeditating");
   if(!can_access(who, item))
      return;
   endif
   var Sleeptime;
   if (!patient)
     SendSysMessage(who, "who would you like to heal?");
     var patient := Target(who, TGTOPT_HELPFUL + TGTOPT_CHECK_LOS);
   endif
   if(!patient)
      SendSysMessage(who, "Cancelled.");
      return;
   endif
   var poisons := ListPoisonsByType(patient, "defaultPoisons");
   if(dist(who, patient) >= 2)
      SendSysMessage(who, "Your patient is too far.");
      return;
   elseif(!CheckLineOfSight(who,patient))
      SendSysMessage(who,"You can't see your patient.");
      return;
   elseif((GetHp(patient) >= GetMaxHp(patient)) and (poisons.size() == 0))
      SendSysMessage(who,"Your patient is at full heath");
      return;
   endif
   detach();
   SetObjProperty(who, "HealTimer", clock);


I think this part is fucking with me:

Code:

   if (!patient)
     SendSysMessage(who, "who would you like to heal?");
     var patient := Target(who, TGTOPT_HELPFUL + TGTOPT_CHECK_LOS);
   endif
   if(!patient)
      SendSysMessage(who, "Cancelled.");
      return;
   endif
   var poisons := ListPoisonsByType(patient, "defaultPoisons");
   if(dist(who, patient) >= 2)
      SendSysMessage(who, "Your patient is too far.");
      return;
   elseif(!CheckLineOfSight(who,patient))
      SendSysMessage(who,"You can't see your patient.");
      return;
   elseif((GetHp(patient) >= GetMaxHp(patient)) and (poisons.size() == 0))
      SendSysMessage(who,"Your patient is at full heath");
      return;
   endif
   detach();
   SetObjProperty(who, "HealTimer", clock);


:]

Author Message
CWO



Joined: 04 Feb 2006
Posts: 691
Location: Chicago, IL USA

PostPosted: Tue Jun 27, 2006 9:34 am    Post subject: Reply with quote

Yes the error is that you dont target anyone.

The <appobj:ScriptExRef> is fine. That means your Start_script is running now without errors. With that working, you can change

var script := Start_Script(":healing:use_bandages", parms);
SendSysMessage(who, CStr(script));

to just

Start_Script(":healing:use_bandages", parms);

To fix the error Object doesnt support members, in the command script, put

Code:
program healme(who)

  SendSysMessage(who, "Who do you want to heal?");
  var patient := Target(who, TGTOPT_HELPFUL + TGTOPT_CHECK_LOS);
  if (!patient)
    SendSysMessage(who, "Cancelled");
    return;
  endif


I also added to the Target command TGTOPT_HELPFUL + TGTOPT_CHECK_LOS because its true you should be able to check LOS and it should be flagged as something helpful so healing a grey and red are criminal actions... unless you dont want these, then you can adjust to the appropriate.

As for

Code:
 if (!patient)
     SendSysMessage(who, "who would you like to heal?");
     var patient := Target(who, TGTOPT_HELPFUL + TGTOPT_CHECK_LOS);
   endif
   if(!patient)
      SendSysMessage(who, "Cancelled.");
      return;
   endif


If this script isnt used for anything else but your command, you can remove

if (!patient)
SendSysMessage(who, "who would you like to heal?");
var patient := Target(who, TGTOPT_HELPFUL + TGTOPT_CHECK_LOS);
endif


but if this is still used by double clicking bandages and stuff, leave it there. What that says is, if it doesnt have a patient (if you got here some other way then the command, you probably dont have it yet) then give you a target. If you still dont have a patient afterwards, cancel. If its only for the command, the corrections to the command script I suggested in this post will handle the targeting.

Post new topic   Reply to topic    PenUltima Online Forum Index -> General Help (095) All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 




Powered by phpBB © 2001, 2005 phpBB Group :: Theme & Graphics by GHS & Scott E. Royalty