Message box - can't successfully add to script

Post » Wed Apr 03, 2013 4:56 pm

I've created a new Message object with 4 options (called "_ShrineDonationKynarethMessage"), and am now trying to add it to my script.

I can't seem to get the new message object to work with my script.

The error I'm getting is "cannot compare a message to a int (cast missing or types unrelated)". I've googled this error, but nothing comes up.

Here's the relevant parts of the script:

Scriptname ShrineDonationKynareth extends ObjectReference   Message Property _ShrineDonationKynarethMessage AutoIdle Property IdlePray AutoActor property PlayerRef autoimport debugEvent OnActivate(ObjectReference akActionRef)	    if akActionRef == PlayerRef					 ;We don't want NPCs activating this                _ShrineDonationKynarethMessage.Show()                if (_ShrineDonationKynarethMessage == 0)		                    game.forcethirdperson()                    Game.GetPlayer().PlayIdle(IdlePray)	                elseIf (_ShrineDonationKynarethMessage == 1)		           ;do whatever needs to be done here    	                elseIf (_ShrineDonationKynarethMessage == 2)				   ;do whatever needs to be done here                elseIf (_ShrineDonationKynarethMessage == 3)				   ;do whatever needs to be done here	                endIf

Any pointers would be much appreciated :)
User avatar
BlackaneseB
 
Posts: 3431
Joined: Sat Sep 23, 2006 1:21 am

Post » Wed Apr 03, 2013 8:27 pm

You can't compare the message itself to 0, 1, etc.

Try this way:

int MyButton = _ShrineDonationKynarethMessage.Show()if ( MyButton == 0);do stuff

also http://wiki.tesnexus.com/index.php/Skyrim_Messagebox_Menu_Tutorial
User avatar
Camden Unglesbee
 
Posts: 3467
Joined: Wed Aug 15, 2007 8:30 am


Return to V - Skyrim