Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

MoveTo in a menu script Crash


JulianSull
 Share

Recommended Posts

I'm working on a house mod right now for my character Raine and this is the creature arena in it. When I go through the menus to the Supreme lich choice, I should move to the arena location. It then freezes when that line is called. I remember reading about some moveto bug in message box scripts but I have searched and can't find anything mentioning it. Anyone know how to fix this?


scn aaaRainesArenaChoiceScript


Short Working

Short Choosing

Short Choice

Short Enemy

Short Number


Begin onActivate

  Set Working to 1

  Set Choosing to -1

End




Begin GameMode

  If Working

    Set Working to 1


    If (Choosing == 0) 

      Set Working to 0



    Elseif (Choosing == -1) 

      Messagebox "What type of enemy?" "Only allow one at a time" "Allow multiple at a time" "Cancel"

      Set Choosing to 1

      Set Choice to -1

    Elseif (Choosing == 1)

      If (Choice == -1) ;No choice yet

        Set Choice to GetButtonPressed

      Elseif (Choice == 0) ;One

        Set Choosing to -11 

      Elseif (Choice == 1) ;Multiple

        Set Choosing to -12

	 Elseif (Choice == 2) ; Cancel

	   Set Choosing to 0

      Endif


	Elseif (Choosing == -11)

		MessageBox "Which enemy would you like to face?" "The Supreme Lich" "The Agony"  "Gravity Blast" "Giant Mastodon" "Eye of the Storm" "Cancel"

		set Choosing to 11

		set Choice to -1

	Elseif (Choosing == 11)

	 	 If (Choice == -1) ;No choice yet

     	   	Set Choice to GetButtonPressed

     	 Elseif (Choice == 0) ;Lich

    	 	   	Set Choosing to -41 

    		 Elseif (Choice == 1) ;Agony

     	   	Set Choosing to -42

    		 Elseif (Choice == 2) ;Gravity

     	   	Set Choosing to -43

    		 Elseif (Choice == 3) ;Giant

     	   	Set Choosing to -44

    		 Elseif (Choice == 4) ;Eye

     	   	Set Choosing to -45

		 Elseif (Choice == 5) ;Cancel

			Set Choosing to 0

     	 Endif


	Elseif (Choosing == -12)

		MessageBox "Which enemy would you like to face?"  "Wolves" "Sniper"  "Bomb" "Durzog" "Mastodon" "Triceratops" "Reaper" "White Rabbit" "Cancel"

		set Choosing to 12

		set Choice to -1

	Elseif (Choosing == 12)

		 If (Choice == -1) ;No choice yet

     	   	Set Choice to GetButtonPressed

     	 Elseif (Choice == 0) ;Wolves

			Set Enemy to 1

    	 	   	Set Choosing to -31 

    		 Elseif (Choice == 1) ;Sniper

			Set Enemy to 2

     	   	Set Choosing to -31

    		 Elseif (Choice == 2) ;Bomb

			Set Enemy to 3

     	   	Set Choosing to -31

    		 Elseif (Choice == 3) ;Durzog

			Set Enemy to 4

     	   	Set Choosing to -31

    		 Elseif (Choice == 4) ;Mastodon

			Set Enemy to 5

     	   	Set Choosing to -31

    		 Elseif (Choice == 5) ;Bomb

			Set Enemy to 6

     	   	Set Choosing to -31

    		 Elseif (Choice == 6) ;Durzog

			Set Enemy to 7

     	   	Set Choosing to -31

    		 Elseif (Choice == 7) ;Mastodon

			Set Enemy to 8

     	   	Set Choosing to -31

		 Elseif (Choice == 8) ;Cancel

			Set Choosing to 0

     	 Endif


	Elseif (Choosing == -41)

		Player.MoveToMarker aaaRainesArenaPlayerStartPoint2

		set working to 0

	Elseif (Choosing == -42)

	Elseif (Choosing == -43)

	Elseif (Choosing == -44)

	Elseif (Choosing == -45)


	endif

endif


end

Link to comment
Share on other sites

        Elseif (Choosing == -41)

                Player.MoveToMarker aaaRainesArenaPlayerStartPoint2

                set working to 0

You need to move the part where you set working to 0 above the MoveToMarker call. MoveTo and MoveToMarker act as a return when called on the player and no further lines of the script are processed for that frame. So your variable is not being reset properly.

Link to comment
Share on other sites

Player is a 'return' when used on the player. So the variable 'working' is never set to 0. Might cause a problem although a CTD is usually not one of them.

This does nothing:

  If Working 
Set Working to 1[/code]

If working == 1 then set working to 1. Does nothing.

I could not follow the script easily since it was coded rather oddly. So I did not verify the rest of the script.

Link to comment
Share on other sites

Ah okay thanks that makes sense. The only reason that bit of code is there is because I copied it off of the template on wiki. I thought it was weird too but I didn't wanna touch it just in case.

EDIT:

I'm getting some more problems with this. The script now teleports me and the enemy to the same marker location. Is there any way I can prevent this? I think I understand why this is happening (Moveto for the lich is going to one location but then it doubles up with mine since it takes so long to move something and thus takes my player's move location instead so we end up in the same spot.

Edited by JulianSull
Link to comment
Share on other sites

 

scn aaaRainesArenaChoiceScript


Short Working

Short Choosing

Short Choice

Short Enemy

Short Number


Begin onActivate

  Set Working to 1

  Set Choosing to -1

End




Begin GameMode

  If Working


    If (Choosing == 0) 

      Set Working to 0



    Elseif (Choosing == -1) 

      Messagebox "What type of enemy?" "Only allow one at a time" "Allow multiple at a time" "Cancel"

      Set Choosing to 1

      Set Choice to -1

    Elseif (Choosing == 1)

      If (Choice == -1) ;No choice yet

        Set Choice to GetButtonPressed

      Elseif (Choice == 0) ;One

        Set Choosing to -11 

      Elseif (Choice == 1) ;Multiple

        Set Choosing to -12

	 Elseif (Choice == 2) ; Cancel

	   Set Choosing to 0

      Endif


	Elseif (Choosing == -11)

		MessageBox "Which enemy would you like to face?" "The Supreme Lich" "The Agony"  "Gravity Blast" "Giant Mastodon" "Eye of the Storm" "Cancel"

		set Choosing to 11

		set Choice to -1

	Elseif (Choosing == 11)

	 	 If (Choice == -1) ;No choice yet

     	   	Set Choice to GetButtonPressed

     	 Elseif (Choice == 0) ;Lich

    	 	   	Set Choosing to -41 

    		 Elseif (Choice == 1) ;Agony

     	   	Set Choosing to -42

    		 Elseif (Choice == 2) ;Gravity

     	   	Set Choosing to -43

    		 Elseif (Choice == 3) ;Giant

     	   	Set Choosing to -44

    		 Elseif (Choice == 4) ;Eye

     	   	Set Choosing to -45

		 Elseif (Choice == 5) ;Cancel

			Set Choosing to 0

     	 Endif


	Elseif (Choosing == -12)

		MessageBox "Which enemy would you like to face?"  "Wolves" "Sniper"  "Bomb" "Durzog" "Mastodon" "Triceratops" "Reaper" "White Rabbit" "Cancel"

		set Choosing to 12

		set Choice to -1

	Elseif (Choosing == 12)

		 If (Choice == -1) ;No choice yet

     	   	Set Choice to GetButtonPressed

     	 Elseif (Choice == 0) ;Wolves

			Set Enemy to 1

    	 	   	Set Choosing to -31 

    		 Elseif (Choice == 1) ;Sniper

			Set Enemy to 2

     	   	Set Choosing to -31

    		 Elseif (Choice == 2) ;Bomb

			Set Enemy to 3

     	   	Set Choosing to -31

    		 Elseif (Choice == 3) ;Durzog

			Set Enemy to 4

     	   	Set Choosing to -31

    		 Elseif (Choice == 4) ;Mastodon

			Set Enemy to 5

     	   	Set Choosing to -31

    		 Elseif (Choice == 5) ;Bomb

			Set Enemy to 6

     	   	Set Choosing to -31

    		 Elseif (Choice == 6) ;Durzog

			Set Enemy to 7

     	   	Set Choosing to -31

    		 Elseif (Choice == 7) ;Mastodon

			Set Enemy to 8

     	   	Set Choosing to -31

		 Elseif (Choice == 8) ;Cancel

			Set Choosing to 0

     	 Endif


	Elseif (Choosing == -41)

		set working to 0

		aaaRainesActivateArenaWalls.Enable

		aaaRainesArenaSupremeLichBossRef.MoveToMarker aaaRainesArenaCreaturePoint1

		Player.MoveToMarker aaaRainesArenaPlayerStartPoint2

	Elseif (Choosing == -42)

	Elseif (Choosing == -43)

	Elseif (Choosing == -44)

	Elseif (Choosing == -45)


	endif

endif


end

So basically I set working to 0, enable the walls of the arena, move the boss enemy to the arena from a separate cell and then move the player to that area. However when i do this it moves both of us to the same point.

Link to comment
Share on other sites

Hmmm looks like it should be working fine. You can get odd misplacements if your cell isn't pathed, or has old pathing that doesn't match your current layout. Have you pathed your arena yet? If not, for testing purposes just place a path node on your aaaRainesArenaCreaturePoint1 marker, and see if the Litch shows up where he's supposed to.

WT

Link to comment
Share on other sites

Not sure if anyone is going to see this but is there a reason my enemy called "Sniper" would want to do this in their birthday suit? Every time before that I moved them to the starting location they would have no clothes on, not equip their weapons and unless I hard coded it into them to equip their stuff, they wouldn't. Ever. Any ideas why for the future?

Link to comment
Share on other sites

Are you placing armor/weapons directly into his inventory, or using Leveled Lists? If the latter post which lists you're using, you might be running into trouble there if testing with a low level character.

WT

Nope. Dark Brotherhood armor, a special bow (Slow speed) and special arrows (Fast speed). That's it.

Link to comment
Share on other sites

They will not equip weapons if its not in their combat profile. Also, if you created these new objects wrong, that would do it too. (wrong slots for armor for example, a tail slot is NEVER equipped.)

If you are scripting the equipment to the NPC after it exists, that can also be a problem sometimes.

Have you verified that the NPC actually has the equipment in their inventory?

Link to comment
Share on other sites

They will not equip weapons if its not in their combat profile. Also, if you created these new objects wrong, that would do it too. (wrong slots for armor for example, a tail slot is NEVER equipped.)

If you are scripting the equipment to the NPC after it exists, that can also be a problem sometimes.

Have you verified that the NPC actually has the equipment in their inventory?

They definitely have it in their inventory and the "Custom" weapons are simply modified Elven Bows renamed. Even when the combat starts, they would have just punched me.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...