Jump to content

Popup Choices for Scenario Scripts


hopeless-ponderer
 Share

Recommended Posts

Github repo: https://github.com/Mare-Nostrum-0AD/popup_choices

Zipfile: popup_choices.1.zip

Hey everyone!

Here's a new feature I've been planning to create for a while. It allows Scenario designers to include "popup choice" menus in their trigger scripts. These popup choice menus can have up to three buttons, with each button (optionally) triggering a function when it is clicked. This allows you to create scenarios with storylines and more interesting scripted events, and also to display information to the player during gameplay (i.e. a "Historical Background" blurb at the beginning of the scenario).

The instructions for how to use this are contained in the README.md of the github repo and zipfile I linked to above. I included an example script at maps/scenarios/demo_popup_choices_triggers.js. To try out the scenario, go to the Scenario selection menu, filter by Demo maps, and look for DEMO: Popup Choices.

You'll have to know at least a little JavaScript to use this feature, of course. I know a lot of you here aren't coders, so I'll try to build a "template" scenario script and a library of functions for simple use cases to make this as accessible as possible to everyone. I'm also willing to help people build their scenarios, as long as it's just a small or medium sized project.

I'm also including this feature in my other mod, Mare Nostrum, from now on.

I hope y'all can make some interesting scenarios with this!

preview.png.fc4cfaff237ed3ab3a1a867d6375f35e.png

  • Like 5
  • Thanks 2
Link to comment
Share on other sites

22 hours ago, Freagarach said:

I'm missing "Yes" in these answers. ;)

More seriously, this seems like an interesting feature for vanilla, mind to make a diff on Phab (if it is different enough from ordinary message boxes)?

Yeah, of course! I have a few ideas I'd like to submit actually, I was just waiting until after A25 was released.

I still need to learn how to use Phabricator though. Do I need to use SVN to submit diffs, or can I generate patches with git? I'd prefer to use git if I can, I already do most of my work on the Github mirror. There's already a git-formatted patch located at dev/patch, btw, which forks from master at the commit saved in dev/git_base.txt.

Link to comment
Share on other sites

  • 6 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...