raccoon122 Posted March 15, 2009 Share Posted March 15, 2009 I'm currently making a mod where it spawns an NPC via a baseball. What I need help with is how to make a menu with a script, one that pops up on the activation of the Pokeball. All I know is scn PBall begin OnActivate ;need to know what goes here end Thanks, I've tried to find a message thing on the Bethsoft page, but I didn't quite understand what it meant. Link to comment Share on other sites More sharing options...
Skree000 Posted March 15, 2009 Share Posted March 15, 2009 i used to love pokemon when i was younger.... you know, a total conversion mod to pokemon of the wasteland would be kind of cool... we would need to model 140 more monsters though lol Link to comment Share on other sites More sharing options...
raccoon122 Posted March 15, 2009 Author Share Posted March 15, 2009 Lol, yeah Do you know how to make menus pop up? :banana: Link to comment Share on other sites More sharing options...
Cipscis Posted March 16, 2009 Share Posted March 16, 2009 My preferred method for scripting menus is to use a scripted token - an unplayable, therefore invisible, piece of armour. This token can be added to the player via AddItem when the menu is to be shown, and uses ShowMessage and GetButtonPressed in order to implement the menu. Single level menus are fairly simple, and you can use a script like this for them (remember that button indices start at 0):ScriptName ExampleMenuScript short Button Begin OnAdd ShowMessage MenuMessage ; MenuMessage is a placeholder for the EditorID of your MESG form End Begin GameMode set Button to GetButtonPressed if Button == -1 ; No buttons have been pressed yet Return elseif Button == 0 ; Result for button 0 elseif Button == 1 ; Result for button 1 elseif ... ... endif End To close the menu, use RemoveMe in a button result script. If you want to create a mutli-level menu, you'll want to introduce a new variable to track the current level of the menu, and probably use a different button variable for each level of the menu. If you get confused with this, hopefully this page can help you - Basic Structure Of A Menu Level Cipscis Link to comment Share on other sites More sharing options...
Skree000 Posted March 16, 2009 Share Posted March 16, 2009 would i be able to make a script for a weapon that, at the press of a button pops a menu up? (ie. for selective fire or secondary fire? ) hmmmm possibilities Link to comment Share on other sites More sharing options...
Cipscis Posted March 16, 2009 Share Posted March 16, 2009 Yep, that would definitely be possible. You'd want to use AddItem in the result of a "keypress" hook (I've re-posted my preferred one at the end of this post), so long as the player has the appropriate weapon equipped and doesn't have the menu token in their inventory. Here's the "keypress" hook:short sIsNPressed if sIsNPressed != IsKeyPressed 49; N set sIsNPressed to sIsNPressed == 0 if sIsNPressed; N has been pressed ; Result endif endif Cipscis Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.