Jump to content

Arena Scripting


bomo99

Recommended Posts

im not very expierenced in modding but i love the way the creater did the Leveler's Towers arena from skyrim did and i was wondering if it was possible to do it in oblivion i have the "Combatants" but i dont know how to make it work with a button.

this is the script as i have it

scn DMRArenaButton
begin onActivate
messageBox "Who's Being Summoned?" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10"
end

begin menumode

end

i hope that someone can help, if anyone can explain how menumode works would appreciate it

if this help i am going to be using a Ayleid push Block.

Link to comment
Share on other sites

You can do a menu like this (if I remembe rcorrectly):

  • your script displays the menu with buttons - this will pause the game, and probably enter MenuMode, but that is irrelevant
  • the player clicks a button, the menu closes, the game enters GameMode
  • in one of the frames (GameMode block executions) immediately following the closing of the menu, the GetButtonPressed function returns the number of the button pressed by the player in that previously open menu - GetButtonPressed will only return the button once, so you need to catch it in a variable

 

Maybe something like this would work... ? Or not?

scriptname DMRArenaButton

short Button
short SelectionActive

begin OnActivate
    set SelectionActive to 1 ; allow running the whole GameMode block for checking the button
    MessageBox "Who's Being Summoned?" "1" "2" "3" "4" "5" "6" "7" "8" "9" "10"
end

begin GameMode

    if ( SelectionActive == 0 )
        return  ; stop here if there is no need to keep checking the pressed button
    endif

    ; in one of the frames (GameMode block executions) immediately following the closing of the menu,
    ; GetButtonPressed returns the pressed button,every other time it returns -1 or somesuch
    set Button to GetButtonPressed

    if ( Button < 0 )
        return ; GetButtonPressed did not find the button number this time, skip the rest
    endif

    ; Button was >= 0 which means the script has finally found the pressed button!
    ; now we can use it, and we can also set the selection mode off
    set SelectionActive to 0

    if ( Button == 0 )
       ...do something....
    ....   

end

The GameMode block runs (almost?) every frame when no menus are open. That is why it might be handy to stop the prosessing with "return" at the very beginning when the GameMode block is not relevant and only toggle it on when it actually is relevant (when player is making a selection). The MenuMode is the 'when-in-menus'equivalent of GameMode.

 

Hopefully that helps a bit. If someone spots a mistake, then feel free to correct. :smile:

 

Edit: Made the list an actual list, oops. :blush:

Edited by Contrathetix
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...