Need help with StartCombat syntaxes!

Post » Tue Jun 19, 2012 11:33 am

So, I'm creating a mod that when you talk to a certain person (WCLeatherWinterhold), he gives a book that gives you 2 choices (similar to Oghma Infinium message box) One choice is to cancel, and another to start combat between the player and "Leather Warrior". But I cannot get the book's script to work:

Spoiler
Scriptname WC1stBattle extends ObjectReference

Alias Property HideGuy Auto
Function ReadChallengeBook(Actor reader)
If(reader!=Game.GetPlayer())
int choice=WCStartBattle.Show()
if(choice==1)
WCHideWarrior.GetActorRef().StartCombat(Game.GetPlayer())
EndIf
EndIf
EndFunction
Message Property WCStartBattle Auto
Actor Property WCHideWarrior Auto

CK keeps saying that GetActorRef() doesnt exist. I'm sorry that I'm such a noob at this. =/
User avatar
Causon-Chambers
 
Posts: 3503
Joined: Sun Oct 15, 2006 11:47 pm

Post » Tue Jun 19, 2012 7:13 am

http://www.creationkit.com/GetActorRef_-_ReferenceAlias is a member of http://www.creationkit.com/ReferenceAlias_Script, but you're trying to call it on an http://www.creationkit.com/Actor_Script, and the function isn't defined in that context.

What are you trying to do by calling that function?

Cipscis
User avatar
BRIANNA
 
Posts: 3438
Joined: Thu Jan 11, 2007 7:51 pm

Post » Tue Jun 19, 2012 7:07 pm

All I'm trying to do is have the Leather Warrior attack the player. When he goes into bleedout, I also need combat to stop and the player recieves an award for defeating him. Seems simple enough.
User avatar
tegan fiamengo
 
Posts: 3455
Joined: Mon Jan 29, 2007 9:53 am

Post » Tue Jun 19, 2012 8:52 am

Just remove the call to http://www.creationkit.com/GetActorRef_-_ReferenceAlias. If you were using a http://www.creationkit.com/ReferenceAlias_Script then it would be required, but you're just using an http://www.creationkit.com/Actor_Script so you already have the information that you're looking for.

The information pointed to by your Actor property is the information you'd hope to get from GetActorRef if you were using a ReferenceAlias instead.

Cipscis
User avatar
Josh Sabatini
 
Posts: 3445
Joined: Wed Nov 14, 2007 9:47 pm

Post » Tue Jun 19, 2012 8:47 am

Ok, to confirm. I can just use:
WCHideWarrior.StartCombat(Game.GetPlayer())

correct?

EDIT: Never mind it worked lol. Thanks for your help!
User avatar
Melis Hristina
 
Posts: 3509
Joined: Sat Jun 17, 2006 10:36 pm


Return to V - Skyrim