and this delivers me to, for example, goblin_ai or orc_ai depending on the enemy_class. With this, it was possible at last to get enemies that behave conspicuously differently. Now my problem is that it punts my nicely nested chain of *gosub commands out of the combat report.
… then that goes back to complete the combat report.
Being able to *gosub combat_script from anywhere in the story progression sounded like a time-saver at the start, but now I’m not so sure. I solved this partially via *goto continue_combat, but it seems rather clunky to have to do this each time for each executed action.
I’m failing to see what your problem is? *gotoref is quite powerful, but it’s applications are different to *gosub.
You don’t really want to dynamically call subroutines, that can get messy and very hard to debug.
Use *gotoref for dynamic/flexible code and use *gosub for SPECIFIC, PREDICTABLE functions.
Edit: Have you checked out the wiki articles covering concatenation, gosub and gotoref/setref? There’s a lot of useful information there and plenty of good examples, I’ve also posted a system or two based upon *gotoref commands. They may be of some help.
Since gotoref is basically a goto, I need another goto out of the chunk. The combat system I’m using is inspired by RPGMaker and its lists of characters, actions, and items. So there’s a lot to manually go through and add again -
It’s kind of hard for me to wrap my head around what you’re trying to do with small snippets of code, and I’m unfamiliar with RPGMaker - Could you write out a process tree? There may be a more efficient way to do it; I just can’t quite grasp the point of concept (idea) at this point.
Sure, doesn’t bother me either way.
I wasn’t trying to suggest you shouldn’t use *gosub though, far from it. You just have to use the right one (*gosub / *goto(ref) ) at the right time.
If you can, try to just link to images. It saves bandwidth for those of us that have little.
You see how `
` is highlighted? That's what code does. `
does the same thing but preserves indentation (``` doesn't), so you should use it for posting snippets of CS code. However, ``` shows HTML (while
` does not).
As for HTML, the forums allows some limited uses, just insert the code directly into the post. I know <a href = "http://www.w3schools.com/tags/att_a_href.asp">href</a> works, I'd imagine that <a href = "http://www.w3schools.com/tags/tag_img.asp">img</a> works too, but I've never bother with it, and, as I said before, it'd be polite to just link.
For example, here's that last paragraph (broken up) displayed via ```:
`As for HTML, the forums allows some limited uses, just insert the code directly
into the post. I know <a href = "http://www.w3schools.com/tags/att_a_href.asp">href</a>
works, I'd imagine that <a href = "http://www.w3schools.com/tags/tag_img.asp">img</a> works
too, but I've never bother with it, and, as I said before, it'd be polite to just link.`