Jump to content

counting dead actor help


littleork

Recommended Posts

Alright I am doing a quest in which you need to kill 10 wolves before it goes to the next stage.My code looks like this

 

 
Event OnDeath(Actor akKiller)
if (Alias_wolf1.GetReference().IsDead() == True) && (Alias_Wolf2.GetReference().IsDead() == True) && (Alias_wolf3.GetReference().IsDead() == True)&& (Alias_wolf4.GetReference().IsDead() == True) && (Alias_wolf5.GetReference().IsDead() == True)&&(Alias_wolf6.GetReference().IsDead() == True) && (Alias_wolf7.GetReference().IsDead() == True) && (Alias_wolf8.GetReference().IsDead() == True)&& (Alias_wolf9.GetReference().IsDead() == True) && (Alias_wolf10.GetReference().IsDead() == True)
rpghunting.SetStage(60)
rpghunting.Setobjectivecompleted(40) 
endIf
endEvent

 

Alright, my problem is that they say that isdead is not a function or does not exist ( I took that code from another user who said that it would work to count the number of actor/wolves that you killed) but since they dont want to acknowledge that the target is dead, I am stuck.Maybe I wrote the code wrong or I am missing a property but I had the wolf1 to wolf10 as a referencealias in my properties, anyone would know what I am doing wrong?

Link to comment
Share on other sites

You get that error because you're trying to use the function on the wrong type of thing.

 

IsDead is expecting you to give it an Actor and you're giving it an ObjectReference.

 

So, instead of

 

if (Alias_wolf1.GetReference().IsDead() == True)

 

Use this

 

if (Alias_wolf1.GetActorRef().IsDead()) && etc.

 

You don't really need the "== TRUE"

Link to comment
Share on other sites

a lot of times that "is not a function/does not exist" error either means you are using the wrong ref type, or you have a typo :P

 

to double check you can always look up the function you are using on the wiki. There is usually useful information over there.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...