I need help spawning npcs from message box options

Post » Tue Jan 14, 2014 12:29 am

Scriptname VenTestScript extends activemagiceffect message property UnitNmbrChoiceMsg autoActor property ImperialMelee auto Event OnEffectStart (Actor Target, Actor Caster)      int ibutton = unitnmbrchoicemsg.show(0.0,0.0)           if ibutton == 1                player.PlaceActorAtMe ImperialMelee 1           elseif ibutton == 2                player.PlaceActorAtMe ImperialMelee 2          EndIf EndEvent
I'm trying to create a magic effect that will show a message box i made (UnitNmbrChoiceMsg) on activation and will spawn either 1 or 2 of the npc i made (imperialmelee) based on which button they click from the UnitNmbrChoiceMsg message box.
Main problems (i think)
1. I don't really know how to use this message script
int Function Show(float afArg1 = 0.0, float afArg2 = 0.0, float afArg3 = 0.0, float afArg4 = 0.0, float afArg5 = 0.0,float afArg6 = 0.0, float afArg7 = 0.0, float afArg8 = 0.0, float afArg9 = 0.0) native
to tell my script which button the player pressed in the message box
2. I'm not sure how to make console commands like player.placeatme run based off of which value gets returned from a properly written version of the script linked above
Any help on understanding how to use that message script better or how to trigger console commands better would be greatly appreciated. I'm extremely new to modding/coding (sorry!) and, while I've been poking around on creationkit.com and other sources like that for the better part of today, I'm still pretty confused
Below are the errors I get when I try to compile with the creation kit

Starting 1 compile threads for 1 files...Compiling "VenTestScript"...C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\VenTestScript.psc(11,10): no viable alternative at input 'PlaceActorAtMe'C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\VenTestScript.psc(11,25): no viable alternative at input 'ImperialMelee'C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\VenTestScript.psc(13,10): no viable alternative at input 'PlaceActorAtMe'C:\Program Files (x86)\Steam\steamapps\common\skyrim\Data\Scripts\Source\temp\VenTestScript.psc(13,25): no viable alternative at input 'ImperialMelee'No output generated for VenTestScript, compilation failed. Batch compile of 1 files finished. 0 succeeded, 1 failed.Failed on VenTestScript

User avatar
~Sylvia~
 
Posts: 3474
Joined: Thu Dec 28, 2006 5:19 am

Post » Mon Jan 13, 2014 9:07 pm

Scriptname VenTestScript extends activemagiceffect message property UnitNmbrChoiceMsg autoActor property ImperialMelee auto Event OnEffectStart (Actor Target, Actor Caster) int ibutton = UnitNmbrChoiceMsg.show()    if ibutton == 1        Game.GetPlayer().PlaceActorAtMe(ImperialMelee, 1)         elseif ibutton == 2                Game.GetPlayer().PlaceActorAtMe(ImperialMelee, 2)    EndIfEndEvent

You cannot use console commands with papyrus. They have to have papyrus equivalents.

About MessageShow() don't understand it myself, but I corrected your syntax. I've never needed to use the arguments.

User avatar
Budgie
 
Posts: 3518
Joined: Sat Oct 14, 2006 2:26 pm


Return to V - Skyrim