Jump to content

Recommended Posts

Posted

I'm trying to make a script that makes an actor show up when activating a certain object, but i have been getting an error that goes like:

 

"c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\trollenc.psc(8,11): type mismatch on parameter 1 (did you forget a cast?)

c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\trollenc.psc(8,35): none is not a known user-defined type

No output generated for trollenc, compilation failed."

 

Here's the code:

Scriptname trollenc extends ObjectReference  

 
ObjectReference Property Markertwo  Auto 
Actor Property Troll  Auto  

Event OnActivate(ObjectReference akActionRef)
Markertwo.Placeactoratme(Troll).StartCombat(Game.GetPlayer())
Endevent

 

 

Can anyone help me with this?

Posted
  On 4/16/2012 at 8:17 PM, needsaname said:

I'm trying to make a script that makes an actor show up when activating a certain object, but i have been getting an error that goes like:

 

"c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\trollenc.psc(8,11): type mismatch on parameter 1 (did you forget a cast?)

c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\trollenc.psc(8,35): none is not a known user-defined type

No output generated for trollenc, compilation failed."

 

Here's the code:

Scriptname trollenc extends ObjectReference  

 
ObjectReference Property Markertwo  Auto 
Actor Property Troll  Auto  

Event OnActivate(ObjectReference akActionRef)
Markertwo.Placeactoratme(Troll).StartCombat(Game.GetPlayer())
Endevent

 

 

Can anyone help me with this?

 

I believe you need to break that up and add a variable.

 

Scriptname trollenc extends ObjectReference  

 
ObjectReference Property Markertwo  Auto 
Actor Property Troll  Auto  

Actor SpawnedTroll

Event OnActivate(ObjectReference akActionRef)
SpawnedTroll = Markertwo.Placeactoratme(Troll)
SpawnedTroll.StartCombat(Game.GetPlayer())
Endevent

 

If you don't need to do anything else with the SpawnedTroll actor after the OnActivate event, you may prefer to put that variable inside the Event block.

Posted
I'm still getting the error "c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\trollenc.psc(10,33): type mismatch on parameter 1 (did you forget a cast?)." The description implies that I'm missing a parameter, but I know I'm not.
Posted
  On 4/16/2012 at 8:48 PM, needsaname said:

I'm still getting the error "c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\trollenc.psc(10,33): type mismatch on parameter 1 (did you forget a cast?)." The description implies that I'm missing a parameter, but I know I'm not.

 

D'oh! How could I have missed it? PlaceActorAtMe requires an ActorBase to place, not an Actor.

Posted
  On 4/16/2012 at 8:54 PM, verteiron said:
  On 4/16/2012 at 8:48 PM, needsaname said:

I'm still getting the error "c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\trollenc.psc(10,33): type mismatch on parameter 1 (did you forget a cast?)." The description implies that I'm missing a parameter, but I know I'm not.

 

D'oh! How could I have missed it? PlaceActorAtMe requires an ActorBase to place, not an Actor.

 

what's an actor base? Is it the numerical ID that the console uses?

Posted
  On 4/16/2012 at 8:59 PM, needsaname said:
  On 4/16/2012 at 8:54 PM, verteiron said:
  On 4/16/2012 at 8:48 PM, needsaname said:

I'm still getting the error "c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\trollenc.psc(10,33): type mismatch on parameter 1 (did you forget a cast?)." The description implies that I'm missing a parameter, but I know I'm not.

 

D'oh! How could I have missed it? PlaceActorAtMe requires an ActorBase to place, not an Actor.

 

what's an actor base? Is it the numerical ID that the console uses?

 

Just change

Actor Property Troll  Auto 

to

Actorbase Property Troll  Auto 

 

Then fill the property in the usual way. You'll probably want to use EncTroll.

Posted

I'm using this now:

Scriptname trollenc extends ObjectReference  

 
ObjectReference Property Markertwo  Auto 
Actor Property Troll  Auto  

Actorbase Property Spawnedtroll  Auto 

Event OnActivate(ObjectReference akActionRef)
       SpawnedTroll = Markertwo.Placeactoratme(Troll)
       SpawnedTroll.StartCombat(Game.GetPlayer())
Endevent

 

and getting this in return:

"Starting 1 compile threads for 1 files...

Compiling "trollenc"...

c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\trollenc.psc(10,33): type mismatch on parameter 1 (did you forget a cast?)

c:\program files\steam\steamapps\common\skyrim\Data\Scripts\Source\temp\trollenc.psc(11,21): StartCombat is not a function or does not exist

No output generated for trollenc, compilation failed.

 

Batch compile of 1 files finished. 0 succeeded, 1 failed.

Failed on trollenc"

Posted (edited)
Scriptname trollenc extends ObjectReference  

ObjectReference Property Markertwo Auto 
Actorbase Property Troll Auto  
Actor SpawnedTroll

Event OnActivate(ObjectReference akActionRef)
SpawnedTroll = Markertwo.Placeactoratme(Troll)
SpawnedTroll.StartCombat(Game.GetPlayer())
Endevent

Edited by fg109
  • Recently Browsing   0 members

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