PenUltima Online

It is currently Fri Sep 05, 2008 11:57 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 19 posts ] 
Author Message
 Post subject:
PostPosted: Tue Jun 27, 2006 12:15 am 
Offline

Joined: Sat Apr 15, 2006 11:50 am
Posts: 66
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 :D

Thanks i reallllly appreciate it.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 27, 2006 12:22 am 
Offline

Joined: Sat Feb 04, 2006 6:26 pm
Posts: 545
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.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 27, 2006 12:31 am 
Offline

Joined: Sat Apr 15, 2006 11:50 am
Posts: 66
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);


:]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 27, 2006 5:34 am 
Offline

Joined: Sat Feb 04, 2006 5:49 pm
Posts: 747
Location: Chicago, IL USA
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Style based on FI Subice by phpBBservice.nl