Jump to content

Script help to place actor at marker


needsaname

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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"

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • Recently Browsing   0 members

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