MightyScript: Lots of Issues

Avatar
  • Views 8.906
  • actualitzat
  • Completed - Resolved

If you want these in separate tickets, let me know.  Some of the issues are seen in the attached test map:

testing_edit_76561197993291628.meta
testing_edit_76561197993291628

1. Obsidian placed with the map editor and then changed with the action "block to type" (in this case, using a world object list as the selected tiles) causes all other obsidian near the selected tiles to detonate (including the ones that were suppose to be changed).

Reproduction: see test map.  Click the door with the brimstone around it, it will change some tiles to earth, but this causes all the obsidian to detonate.  Clicking the adjacent door will replace everything with "script placed obsidian" and if you try the brimstone door again, it changes the tiles as expected.


2. Spawn Defense doesn't work with lists.

Reproduction: see test map.  The 2 doors near the edge of the map are setup to spawn doors when clicked.  One of them spawns using a list and one spawns using a selected tile.  Furthermore, all doors send a console debug message, however the one that tries to spawn the doors via a list does not send a console message (since it appears it causes an error and stops the rest of the actions from firing).


3. Spawn Party doesn't work with lists that contain multiple locations

Reproduction: see test map.  Edit the script for door3 and add a spawn party action.  Use party 1 and use list "Spawners" which contains 3 preselected tiles.  When you click the door, it spawns the party at the first tile and ignores the next 2.


4. Units will attack "shielded doors".  Not sure if this occurs with other attackable objects, but doors that are shielded with the action "create shield dependency" are still targeted by units.  The units do no damage, but they will still target it and try to attack it.


5. Some actions that only allow 1 object to be used (ie. set block type) allow for multiple selections in the magic finder.  Not sure if this is intended or not.  Example of how multiple selections could work: If you select dirt/earth/water in "set block type", then it could randomly choose one of those blocks when changing a block type.


6. Multiple graphical glitches when changing from one type of block to another using either the map editor (ie. manually changing a block type) or using the "set block type" action.  The glitches I noticed were when changing a faction owned tile to a neutral tile, then the neutral tile has "faction walls" when it shouldn't.

Reproduction: place a 5x5 claimed tile for the empire, then place an earth tile in the same 5x5 space but for "terrain" or "neutral".  The 5x5 area will still have "empire walls" everywhere.

Fix? It seems like the tile's properties aren't being reset for "wall graphic" and thus the wall graphic is still referencing the previous owner (empire).


7. You can't place sacred ground (manually) on tiles that have gold piles.

Reproduction: see test map.  The area where the sacred ground is has a bunch of gold piles (it use to be a vault that I replaced with claimed tiles).  Try placing a sacred ground on a tile with a gold pile and you can't.

Fix?  Can you just delete the gold pile when sacred earth is placed?  (or any other objects that may stop you from placing a tile manually)


8. Gold pile graphics disappear in the map editor but the object still exists.

Reproduction: see test map.  The area surrounded by the sacred ground.   On my view, the area near the wall has gold piles but no graphics for the gold piles.  Not sure what caused this.  The whole area where the gold piles are use to be vaults that were replaced by claimed tiles.


9. Suggestion: highlight objects selected by magic finder.  When using the "set reveal" action and selecting an inhibitor, the tile/inhibitor is not highlighted.  I have no idea if this is a bug or not.  IMO the tile or the inhibitor should be highlighted to indicate the center of the reveal.


10. Lists (arrays) need a lot of work imo.  They have such potential but MS lacks the actions to work with them.  I wrote a post on the steam forums about this but I'll briefly echo my thoughts below:


i. No ability to loop through lists (ie. think "arrays").  It'd be nice to have an action that "loop through list, set/get a variable/pointer and activate a trigger".  Thus you could say loop through a list of world objects, get each object, set/store that object into a new list (ie. like the pick action) and then fire a trigger.  A new script with the trigger can then access the stored object and do actions against it.


ii. No way to get and use a list id.  It would be super helpful if there was a way to get/store a list when given multiple lists.  This could be a new output type (ie. instead of triggering entity, we have list(s) that contain triggering entity).  Example of how I would use it: I have 20 lists that each have some blocks in them (some have the same blocks).  Whenever one of these blocks is changed (ie. claimed), I want to be able to get/store the lists with that block and be able to do actions on it.

Pseudo code: trigger: "on block type change" where 'what block' = '20 lists' (so when a block changes, we look through all the lists to see if the block is in those lists) and 'output' = 'new type: lists with trigger entity' (which gets set/stored in a temp list and contains only the lists which had the triggering block); then action could be something like (numberA = count list (output list)), (spawn party at some spot; execute numberA times) and (delete all entities in output lists).


iii. Lists have specific data types.  Can we have a dynamic list that works with all data types (numbers, strings, objects, etc) and then you program a function to get the data type of the cell being accessed and ignore that cell if it is trying to be used wrong.  ie. list = ["String", 10, 20.2, {location object}].  If I try to spawn a party using the list, then cells 0,1,2 are ignored but 3 is fine.  If I output the list to console, then 0,1,2 are outputed and 3 shows "game object" or whatever.


iv. No multidimensional lists.  It'd be awesome to be able to store lists inside of lists and then loop through them for other things.  I imagine this wouldn't be hard to add?  The usage would be more beneficial for dynamic adding/removing of data.  ie. Each time I create a "spawn party wave", I add their entities to a list and add that list to a "total wave list" where each cell/index/whatever contains a list of entities spawned together.  I could select an index and delete/destroy all the entities in that single list.


11. String substitution/replacing only works for objectives and announcements.  I looked at your code with dnspy and noticed how you use string.replace for stuff like "P1Color" but it isn't a global function, just limited to a single object.  I think you should have a custom function that applies to all strings so you can use this sub/replace code wherever mightyscript would allow it.  This would allow for using the code in other areas like debug/console, objective title/description, chat message, etc.  Further, it means you can add additional replace/sub options more easily.

Ideas:  I would love to see some additional usage like being able to access variables/objects (created in MS) via id.  ie. if I wanted to show a number variable in debug console using the debug action, then I wish I could write something like "Test Number {Number:25}" to output "Test Number 200" where the number with id 25 = "200".

Simplified: {"Type":"ID"} returns variable/object with id.  Such as {List:5} prints out all the IDs/names from the list where ID=5.  Or {Timer:2} outputs the timer(id=2) state (running/stopped) and time.  Or {Switch:1} outputs the boolean of switch(id=1) (true/false).


TL;DR: I spent 6 hours in the map editor today and noticed a few bugs.  I wish there was some additional functionality so I can make better maps!


PS: I LOVE the new changes to MS/editor with the recent patch.  There are some nice quality of life improvements.  I like the direction you are going with the editor and hope to see further improvements in the coming months.

Game Version:
Steam Public
Platform:
Windows