needsaname Posted April 16, 2012 Share Posted April 16, 2012 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 typeNo 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 More sharing options...
verteiron Posted April 16, 2012 Share Posted April 16, 2012 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 typeNo 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 More sharing options...
needsaname Posted April 16, 2012 Author Share Posted April 16, 2012 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 More sharing options...
verteiron Posted April 16, 2012 Share Posted April 16, 2012 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 More sharing options...
needsaname Posted April 16, 2012 Author Share Posted April 16, 2012 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 More sharing options...
verteiron Posted April 16, 2012 Share Posted April 16, 2012 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 changeActor Property Troll Auto toActorbase 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 More sharing options...
needsaname Posted April 16, 2012 Author Share Posted April 16, 2012 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 existNo 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 More sharing options...
fg109 Posted April 16, 2012 Share Posted April 16, 2012 (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 April 16, 2012 by fg109 Link to comment Share on other sites More sharing options...
needsaname Posted April 16, 2012 Author Share Posted April 16, 2012 That worked! So you have to define what it spawns as? Jeez, they really made the scripting a pain in the butt compared to the Morrowind days. Link to comment Share on other sites More sharing options...
Recommended Posts