Author Topic: Bad Argument to call_other() on Generic NPC?  (Read 2708 times)

Offline Lycaon

  • Acquaintance
  • *
  • Posts: 3
    • View Profile
Bad Argument to call_other() on Generic NPC?
« on: November 24, 2007, 06:48:04 pm »
Well, hi all.

New to Dead Souls, but have been doing C(++) for 3 or so years now. Anyway, I'm trying to create a dead NPC, here's what I've done thus far:
Code: [Select]
create npc start_deceased
modify npc SetHealthPoints(0) {Is that the correct way to do this?}

However, doing the above returns this error message:
Code: [Select]
*Bad argument 1 to call_other()
Expected: string or array or object Got: 0.
Object: /domains/default/npc/start_mother_deceased#30 (/lib/combat.c) at line
500

'<fake>' at /secure/obj/staff#16 (/<driver>) at line 0
'eventGetArray' at /secure/obj/staff#16 (/secure/modules/generic.c) at line 158
'eventResumeArrayMod' at /secure/obj/staff#16 (/secure/modules/create.c) at
line 709
'reload' at /secure/sefun/sefun at /secure/sefun/reload.c:87
'unguarded' at /secure/sefun/sefun at /secure/sefun/security.c:100
'apply_unguarded' at /secure/daemon/master at line 466
'CATCH' at /secure/daemon/master at line 466
'<fake>' at /secure/sefun/sefun (/<driver>) at line 0
'(: <code>() :)' at /secure/sefun/sefun at /secure/sefun/reload.c:87
'create' at /domains/default/npc/start_mother_deceased#30 at line 15
'SetHealthPoints' at /domains/default/npc/start_mother_deceased#30 (/lib/npc.c)
at line 695
'AddHealthPoints' at /domains/default/npc/start_mother_deceased#30
(/lib/body.c) at line 1523
'eventDie' at /domains/default/npc/start_mother_deceased#30 (/lib/npc.c) at
line 431
'eventDie' at /domains/default/npc/start_mother_deceased#30 (/lib/combat.c) at
line 500
Trace written to /log/catch

Now, I'm guessing this is something real simple, probably an incorrect argument or just using the wrong method.
But, Like I said new to DS and LPC in general.

I'll keep playing around, but thanks.

Offline Lycaon

  • Acquaintance
  • *
  • Posts: 3
    • View Profile
Re: Bad Argument to call_other() on Generic NPC?
« Reply #1 on: November 24, 2007, 07:01:45 pm »
Of course, it seems I can just zap the thing and call 'modify SetNoClean 1', however, well, I don't know... Is there a more 'proper' way to do this?

Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1024
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
Re: Bad Argument to call_other() on Generic NPC?
« Reply #2 on: November 24, 2007, 07:03:06 pm »
Quote
create npc start_deceased
modify npc SetHealthPoints(0) {Is that the correct way to do this?}

Setting an npc's health points to zero will cause problems, yes. You
are basically killing it before it's born. I tested it a couple of times
and I get the same results.

The syntax you're using isn't quite right, in any case. You're looking for something like:

Quote
create npc start_deceased
modify npc SetHealthPoints 10

-Crat

Offline Lycaon

  • Acquaintance
  • *
  • Posts: 3
    • View Profile
Re: Bad Argument to call_other() on Generic NPC?
« Reply #3 on: November 24, 2007, 07:09:32 pm »
Ahh, o.k. Thanks.

Yeah, I'm aware of the syntax ;) Kind of rushed it out before checking. Guess I should use the preview button more, hmm?

Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1024
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
Re: Bad Argument to call_other() on Generic NPC?
« Reply #4 on: November 24, 2007, 07:10:07 pm »
From the name of the npc I assume you *want* it dead.

I would put a call_out in its create() function to kill it after it has
a chance to actually be alive.

Code: [Select]
    call_out( (: AddHP :), 0, -9000);

-Crat

Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1024
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
Re: Bad Argument to call_other() on Generic NPC?
« Reply #5 on: November 24, 2007, 07:14:02 pm »
Just a quick note, I'm sorry if my tone is curt, it's one of those
evenings where I'm doing 4 things at once and I don't want to
ignore you after asking you to post here!

-Crat

Offline cratylus

  • Your favorite and best
  • Administrator
  • ***
  • Posts: 1024
  • Cratylus@Dead Souls <ds> np
    • View Profile
    • About Cratylus
Re: Bad Argument to call_other() on Generic NPC?
« Reply #6 on: November 24, 2007, 07:22:26 pm »
Quote
Is there a more 'proper' way to do this?

Probably the most elegant way to do it is to clone a corpse, rather
than kill an npc for its corpse, then set its values the way you want
(whose corpse it is, etc), and add the inventory you feel it should have.

check out the SetCorpse() function in LIB_CORPSE for details.

-Crat


Offline daelaskai

  • BFF
  • ***
  • Posts: 174
    • View Profile
Re: Bad Argument to call_other() on Generic NPC?
« Reply #7 on: November 24, 2007, 07:23:13 pm »
There is also the option of doing SetRace("wraith") or, as players when they die, they become they become ghosts.  I believe this is done by SetUndead(1), though I don't know if this works for NPCs.

Daelas