Jump to content
rainlash

The Lion Throne (Fangame and Engine)

Recommended Posts

This crash happened during preparations:

*** Lex Talionis Engine Version 0.9.3.8 ***


Main Crash can't pickle pygame.Surface objects
Traceback (most recent call last):
  File "main.py", line 116, in <module>
  File "main.py", line 43, in main
  File "main.py", line 61, in run
  File "Code\StateMachine.py", line 198, in update
    update_output = self.state[-1].update(gameStateObj, metaDataObj)
  File "Code\Transitions.py", line 1196, in update
    SaveLoad.suspendGame(gameStateObj, gameStateObj.save_kind, slot=gameStateObj.activeMenu.getSelectionIndex())
  File "Code\SaveLoad.py", line 576, in suspendGame
    gameStateObj.saving_thread = threading.Thread(target=save_io, args=(copy.deepcopy(to_save), copy.deepcopy(to_save_meta), old_slot, slot, hard_loc))
  File "copy.py", line 150, in deepcopy
  File "copy.py", line 240, in _deepcopy_dict
  File "copy.py", line 150, in deepcopy
  File "copy.py", line 220, in _deepcopy_tuple
  File "copy.py", line 220, in <listcomp>
  File "copy.py", line 150, in deepcopy
  File "copy.py", line 215, in _deepcopy_list
  File "copy.py", line 150, in deepcopy
  File "copy.py", line 220, in _deepcopy_tuple
  File "copy.py", line 220, in <listcomp>
  File "copy.py", line 150, in deepcopy
  File "copy.py", line 240, in _deepcopy_dict
  File "copy.py", line 150, in deepcopy
  File "copy.py", line 220, in _deepcopy_tuple
  File "copy.py", line 220, in <listcomp>
  File "copy.py", line 180, in deepcopy
  File "copy.py", line 280, in _reconstruct
  File "copy.py", line 150, in deepcopy
  File "copy.py", line 240, in _deepcopy_dict
  File "copy.py", line 150, in deepcopy
  File "copy.py", line 215, in _deepcopy_list
  File "copy.py", line 180, in deepcopy
  File "copy.py", line 280, in _reconstruct
  File "copy.py", line 150, in deepcopy
  File "copy.py", line 240, in _deepcopy_dict
  File "copy.py", line 180, in deepcopy
  File "copy.py", line 280, in _reconstruct
  File "copy.py", line 150, in deepcopy
  File "copy.py", line 240, in _deepcopy_dict
  File "copy.py", line 169, in deepcopy
TypeError: can't pickle pygame.Surface objects

It seems to be in regards to the List command, specifically when using it to swap items with the convoy.  At least I think that's the cause.  Then it crashes when attempting to save or play the map afterwards.

Share this post


Link to post
Share on other sites
On 12/20/2019 at 7:23 PM, BBHood217 said:

It seems to be in regards to the List command, specifically when using it to swap items with the convoy.  At least I think that's the cause.  Then it crashes when attempting to save or play the map afterwards.

Thanks for the bug report! I never would have found this without the report! Saving the turnwheel's action log is very complicated, and it was trying to save the convoy as a unit when this occurred. There's a new upload of the Engine (v0.9.3.9) at the usual place which has this fixed, along with a couple of other small trade menu related issues.

I also added a title screen particle flag to the constants.ini file. 

You can add the line

title_particles=None

to turn off the particles on the title screen, or set it to one of ["Smoke", "Fire", "Dark"] (the three weather systems that actually work on the title screen). For instance:

title_particles=Fire

to get Fire. "Smoke" is the default. "Dark" is kind of boring. "Fire" looks pretty neat though.

Share this post


Link to post
Share on other sites

Now that I've released my game, you might find it useful to see how I did things and also find some more bugs.  There are a few things I found while working on it up to testing and releasing it, and you can use my game to test for them.  Note that my game is still using v0.9.3.8 so these might have already been fixed in that update you just released.

- The List thing has already (hopefully) been fixed.  I can't take all the credit for that, MK404 and LordGlenn found it while betatesting the game.
- Something about the Merge command is causing a crash, happening around when you try to merge more than one item in one session (as in without backing out).
- Are skill charges supposed to carry over between chapters?  Skill charges are empty when starting a chapter after opening the game, but not in the next chapter if you keep on playing.
- Sol is now a proc skill, but its description still calls it an activated skill.  Also, is there a way to bring back the activated versions of Sol and Luna?
- "Discard_info" doesn't seem to work, it just shows "Discard" over and over instead of the defined string.  "Storage_info" is fine though.
- This is kind of a big one.  You know how the turnwheel has limited uses?  Turns out that number of uses is just an illusion and it can go into negative numbers.  So the turnwheel actually has infinite uses, and people can just choose to play along with the number of uses or not.
- This one is odd and hard to describe.  My game has a unit called PrincessBoss; and for some reason when a generic princessboss is in a map, trying to load that map causes the game to hang.  It just freezes, with no error messages whatsoever.  It runs fine if the princessboss is a character though.  I don't know what to make of this.

That's all I've found so far.  If there are more, perhaps other people can find and report them.  In fact, I've been thinking about that and I have to ask you something.  As far as I know, Serenes Forest is the only place you've shown your game engine so far.  Have you considered posting about it in other sites too, like FE Universe?  It'll help make the engine known to more people, they could give you more feedback and bug reports, and maybe some of them could even help you with the engine itself if they have the coding knowledge.

Share this post


Link to post
Share on other sites

I started using your engine recently and I was trying to create a chapter like the wagons one in Lion Throne but I can't seem to find the script where you increase the dead_wagons or escaped wagons constant, any chance you could help with that? Also, is it possible to create exp potions that function as the bonus exp mechanic in  path of radiance?

 

Edit: Re-read the tutorial and managed to see that they are incremented in the death and escape txts.  The exp potions can maybe be made with the call item script txt since there is a give exp command, but i can't find any example on how to use call item script, any suggestions?

Edited by djtrak
Found the solution

Share this post


Link to post
Share on other sites
On 12/23/2019 at 3:16 PM, BBHood217 said:

- Something about the Merge command is causing a crash, happening around when you try to merge more than one item in one session (as in without backing out).

I've not been able to find this bug -- I tried multiple merges of one item, and multiple merges of different items, both in the same session, and nothing broke on my end. If you can find a specific way to recreate the bug, please forward it to me -- or the error message, so I at least have an idea of where to start.

On 12/23/2019 at 3:16 PM, BBHood217 said:

- Are skill charges supposed to carry over between chapters?  Skill charges are empty when starting a chapter after opening the game, but not in the next chapter if you keep on playing.
- Sol is now a proc skill, but its description still calls it an activated skill.  Also, is there a way to bring back the activated versions of Sol and Luna?
- "Discard_info" doesn't seem to work, it just shows "Discard" over and over instead of the defined string.  "Storage_info" is fine though.

These are now fixed in the latest update to the Engine (v0.9.3.10). The activated versions of Sol and Luna are the default, but the proc version are also still around in the status.xml if you wanted to use them instead as a basis.

On 12/23/2019 at 3:16 PM, BBHood217 said:

- This is kind of a big one.  You know how the turnwheel has limited uses?  Turns out that number of uses is just an illusion and it can go into negative numbers.  So the turnwheel actually has infinite uses, and people can just choose to play along with the number of uses or not.

As far as I can tell, this should only happen when "cheat=1" is set in the config.ini file. If so, this is a feature, not a bug -- so it's easier to test with. Switch it to "cheat=0" in the main "Data/config.ini" when you ship the game.

On 12/23/2019 at 3:16 PM, BBHood217 said:

- This one is odd and hard to describe.  My game has a unit called PrincessBoss; and for some reason when a generic princessboss is in a map, trying to load that map causes the game to hang.  It just freezes, with no error messages whatsoever.  It runs fine if the princessboss is a character though.  I don't know what to make of this.

I have no idea where to start on this one either -- if there is no error message, then this will be very hard to debug. If you can send me the minimum data necessary to repeat the bug, I can take a look. It only happens with the one class type? If so, I would check the images associated with the class type -- maybe one of them is missing or buggy? But I really don't know...

On 12/27/2019 at 12:18 PM, djtrak said:

I started using your engine recently and I was trying to create a chapter like the wagons one in Lion Throne but I can't seem to find the script where you increase the dead_wagons or escaped wagons constant, any chance you could help with that? Also, is it possible to create exp potions that function as the bonus exp mechanic in  path of radiance?

 

Edit: Re-read the tutorial and managed to see that they are incremented in the death and escape txts.  The exp potions can maybe be made with the call item script txt since there is a give exp command, but i can't find any example on how to use call item script, any suggestions?

I'm glad you figured it out.

The call item script is very elite tech for the Engine, and most of the things you could do with it would cause the game to crash unceremoniously, so I don't recommend using it if possible. However, the exp potion idea is a good case for using it. Try setting up an item like so:

    <item name="Exp Drink">
        <id>Exp Drink</id>
        <spritetype>Consumable</spritetype>
        <spriteid>8</spriteid>
        <components>usable,uses,map_hit_color,call_item_script,booster</components>

        <uses>2</uses>
        <RNG>0</RNG>
        <value>300</value>
        <desc>A draught that gives 50 exp.</desc>

        <map_hit_color>96,144,232</map_hit_color>
    </item>

The item must have the call_item_component component, booster component, and usable component to work.

Then, create a file called "Data/callItemScript.txt" in your Data directory.

# A sample call item script
if;self.unit2.id == "Exp Drink"
    give_exp;{unit};50
end

The first unit is the unit you are using the item on, and the unit2 is the item itself. This script is shared by all items that have the call_item_script component, so if you have more than one you must check the item id to determine what to do -- just like I did. Edit: Also, this will only work in the newest update to the Engine since I fixed a bug associated with the call item script component.

 

There's a new build (v0.9.3.10) out new that fixes these bugs described above, along with a terrain_layer bug that someone else reported to me directly. Happy new year!

Edited by rainlash
call_item_script only works correctly in 0.9.3.10+

Share this post


Link to post
Share on other sites
9 hours ago, rainlash said:

I've not been able to find this bug -- I tried multiple merges of one item, and multiple merges of different items, both in the same session, and nothing broke on my end. If you can find a specific way to recreate the bug, please forward it to me -- or the error message, so I at least have an idea of where to start.

Well, here's the error message:

Traceback (most recent call last):
  File "main.py", line 116, in <module>
  File "main.py", line 43, in main
  File "main.py", line 61, in run
  File "Code\StateMachine.py", line 205, in update
    mapSurf = self.state[-1].draw(gameStateObj, metaDataObj)
  File "Code\PrepBase.py", line 1069, in draw
    self.owner_menu.draw(mapSurf)
  File "Code\MenuFunctions.py", line 384, in draw
    self.vert_draw(surf)
  File "Code\MenuFunctions.py", line 422, in vert_draw
    main_font = GC.FONT[self.color_control[index+self.scroll]]
IndexError: list index out of range

I think I've also figured out the cause.  It happens when, after merging an item to full uses, you then try to take an item from the convoy without backing out of the menu.
 

9 hours ago, rainlash said:

As far as I can tell, this should only happen when "cheat=1" is set in the config.ini file. If so, this is a feature, not a bug -- so it's easier to test with. Switch it to "cheat=0" in the main "Data/config.ini" when you ship the game.

Well then, now I feel silly.  Of course I have it set to 1, I was working on the game.  Don't worry, I switched it off before the release.
 

9 hours ago, rainlash said:

I have no idea where to start on this one either -- if there is no error message, then this will be very hard to debug. If you can send me the minimum data necessary to repeat the bug, I can take a look. It only happens with the one class type? If so, I would check the images associated with the class type -- maybe one of them is missing or buggy? But I really don't know...

I'm not entirely sure myself what the cause could be, so maybe it'll be better if you just get everything and download the whole game if it's not too much trouble for you.  You can place a generic princessboss in the debug level, and then try to load the debug level in the game and see what happens.

Share this post


Link to post
Share on other sites
20 hours ago, rainlash said:

Edited 4 hours ago by rainlash
call_item_script only works correctly in 0.9.3.10

Thanks, tried it yesterday with an older version and it wasn't working, updated it today and it is working now. Although it seems that updating broke something, I am using 'replace_tile;2,8;1' to change a tile in the intro script and this was working with an older version although now I am getting the following bug:

Spoiler

8686   ERROR:            main:
Traceback (most recent call last):
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\main.py", line 116, in <module>
    main()
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\main.py", line 43, in main
    run(gameStateObj, metaDataObj)
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\main.py", line 64, in run
    mapSurf, repeat = gameStateObj.stateMachine.update([], gameStateObj, metaDataObj)
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\Code\StateMachine.py", line 198, in update
    update_output = self.state[-1].update(gameStateObj, metaDataObj)
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\Code\GeneralStates.py", line 2096, in update
    self.message.update(gameStateObj, metaDataObj)
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\Code\Dialogue.py", line 199, in update
    self.read_script(gameStateObj, metaDataObj)
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\Code\Dialogue.py", line 135, in read_script
    self.parse_line(line, gameStateObj, metaDataObj)
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\Code\Dialogue.py", line 823, in parse_line
    Action.do(Action.ReplaceTiles(pos_list, tile_id), gameStateObj)
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\Code\Action.py", line 1877, in do
    action.do(gameStateObj)
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\Code\Action.py", line 1674, in do
    gameStateObj.map.replace_tile(position, self.terrain_id, gameStateObj.grid_manager)
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\Code\TileObject.py", line 420, in replace_tile
    self._tiles[coord] = self.get_tile_from_id(tile_id)
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\Code\TileObject.py", line 235, in get_tile_from_id
    tile = TileObject(tile_id, terrain.get('name'), terrain.find('minimap').text, terrain.find('platform').text,
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\Code\TileObject.py", line 712, in __init__
    assert type(self.position) == tuple
AssertionError

 

I am also having a problem for some time now with both the newer version and an older one, where any time(when a unit causes a game over screen it works fine) a player unit dies the game crashes.

Spoiler

60020   ERROR:            main: 'NoneType' object is not subscriptable
Traceback (most recent call last):
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\main.py", line 116, in <module>
    main()
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\main.py", line 43, in main
    run(gameStateObj, metaDataObj)
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\main.py", line 64, in run
    mapSurf, repeat = gameStateObj.stateMachine.update([], gameStateObj, metaDataObj)
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\Code\StateMachine.py", line 198, in update
    update_output = self.state[-1].update(gameStateObj, metaDataObj)
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\Code\GeneralStates.py", line 2096, in update
    self.message.update(gameStateObj, metaDataObj)
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\Code\Dialogue.py", line 199, in update
    self.read_script(gameStateObj, metaDataObj)
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\Code\Dialogue.py", line 134, in read_script
    if (self.if_flag or self.handle_if(line, gameStateObj, metaDataObj)) and (not self.do_skip or not (line[0] in self.skippable_commands)):
  File "C:\Users\Admin\Desktop\FEstuff\lex-talionis\Code\Dialogue.py", line 156, in handle_if
    truth = eval(line[1])
  File "<string>", line 1, in <module>
TypeError: 'NoneType' object is not subscriptable

Not sure if you need the bigger logs,  I can provide them if you think they are necessary.

Any help you could provide is appreciated, happy new year!

Share this post


Link to post
Share on other sites

New build of the Engine is up. v0.9.3.11

14 hours ago, BBHood217 said:

I think I've also figured out the cause.  It happens when, after merging an item to full uses, you then try to take an item from the convoy without backing out of the menu

Fixed. Thanks for the error log.

14 hours ago, BBHood217 said:

I'm not entirely sure myself what the cause could be, so maybe it'll be better if you just get everything and download the whole game if it's not too much trouble for you.  You can place a generic princessboss in the debug level, and then try to load the debug level in the game and see what happens.

Okay I figured this one out too... It's a really insignificant bug on my end, but it basically meant you couldn't have tier 3 or greater generic units. The code would enter an infinite loop on trying to process any tier 3 or greater generic units. This has been fixed in v0.9.3.11.

2 hours ago, djtrak said:

Although it seems that updating broke something, I am using 'replace_tile;2,8;1' to change a tile in the intro script and this was working with an older version although now I am getting the following bug:

Thanks for the bug report. This has been fixed. There may be a couple of additional bugs like this lurking about. I made the Tile Objects check their position at instantiation because I want to catch all weird bugs where a tile object does not have a position. This is what caught a different unrelated replace tile bug.

2 hours ago, djtrak said:

I am also having a problem for some time now with both the newer version and an older one, where any time(when a unit causes a game over screen it works fine) a player unit dies the game crashes.

This is likely an issue with your death_quote_info.txt script. There's an "if statement" you wrote somewhere in the script that the Engine is incapable of parsing. You can give me the debug.log.1 that has the issue + the death quote info script and I can take a closer look if that's not enough information for you to solve the issue.

Share this post


Link to post
Share on other sites

So I haven't managed to fix the problem but I have been working around it hoping that I'll eventually find the culprit. Meanwhile I had some ideas that I am not sure are doable so I came here to make sure; is it possible to get information on which type of tile an unit is currently standing? I was thinking about making something like the Indoor/Outdoor Fighter skills but haven't found a way to get tile information.

Another thing I wanted to make were event based promotions but I believe that the promotional items are the only way to promote units right now, it's unfortunate since the promotional items force the promotion selection. I guess it's possible to have repeated classes and for example just have Fighter1 promote to Warrior and Fighter2 promote to Berserker although that's not a very elegant solution.

One last thing, does making the LVL of a weapon a specific character's name eliminate the need for weapon rank on that weapon's type? I tried to port Wyrmsfire, changing the LVL of it to the name of one of my characters, but the spell appears greyed out and isn't usable, am I missing something?

Thanks as always.

Share this post


Link to post
Share on other sites
11 hours ago, djtrak said:

So I haven't managed to fix the problem but I have been working around it hoping that I'll eventually find the culprit. Meanwhile I had some ideas that I am not sure are doable so I came here to make sure; is it possible to get information on which type of tile an unit is currently standing? I was thinking about making something like the Indoor/Outdoor Fighter skills but haven't found a way to get tile information.

Can you receive PMs? I sent a PM to you about your death quote info problem earlier this month. The problem is not with your death_quote_info.txt script, it's earlier in the chain -- probably your interactScript.txt for the level. Send me that one and I can take a look again.

 

Also, tile information is readable, as long as the gameStateObj is accessible. So you can read tile information from events scripts and from the "mt", "hit", etc. item components. Here's an example for the latter:

    <status name="Ranger's Guile">
        <id>Rangers Guile</id>
        <image_index>8,1</image_index>
        <desc>Grants +30 hit while on Plains or Forest.</desc>
        <components>hit,class_skill</components>

        <hit>30 if gameStateObj.map.tiles[self.position].name in ('Plain', 'Forest') else 0</hit>
    </status>

 

12 hours ago, djtrak said:

Another thing I wanted to make were event based promotions but I believe that the promotional items are the only way to promote units right now, it's unfortunate since the promotional items force the promotion selection. I guess it's possible to have repeated classes and for example just have Fighter1 promote to Warrior and Fighter2 promote to Berserker although that's not a very elegant solution.

Yeah, this doesn't seem to possible right now. If a class has a choice of promotions, that choice is always available no matter how you promote.

12 hours ago, djtrak said:

One last thing, does making the LVL of a weapon a specific character's name eliminate the need for weapon rank on that weapon's type? I tried to port Wyrmsfire, changing the LVL of it to the name of one of my characters, but the spell appears greyed out and isn't usable, am I missing something?

Changing the LVL of a weapon to a specific character obviates the need for any specific weapon rank on that weapon type, but you still need to have at least 1 point in that weapon to wield a weapon of that type. As an example, making Wyrmsfire an "Ophie" LVL weapon would not let Ophie use the weapon while a Myrmidon (since Wyrmsfire is not a sword). As far as I know this is how Fire Emblem normally works. For instance, I believe Chrom can't wield Falchion while an Archer.

Share this post


Link to post
Share on other sites
On 8/21/2019 at 10:45 AM, Ashai said:

Is there a constant to change the pitch of the title screen music?

Way back when I asked this, I thought it was intentional that the title screen was playing Helms Deep - Start/Loop at a slower rate, but it seems that this is tied to the audio sample rate of the file itself. Helms Deep has a sample rate of 48.000 kHz, so it is playing slower than it should be.

You can see this happening with Midna's Theme as well because it has the same sample rate.
But if you try something else with a sample rate of 44.000 kHz, like Awakening - Easy Now, you can hear the song play at a normal speed.

Share this post


Link to post
Share on other sites

Just some issues I had with the engine that I put on the GitLab issues page, thought I might post them here as well.

 

- I am using the pygame version for the additional customization offered by python code.

- Whenever you open the editor, the MapSprite.png file is overwritten with a blank one, and you have to constantly call for the file again. Additionally, if you have a TileData.png made and you're working on it with that map, saving the tiledata deletes the MapSprite again. This makes it practically impossible to work on anything without constantly making copies of your TileData, which gets deleted everytime you re-import your MapSprite.

- Additionally, copying the tutorial and deleting all The Lion Throne characters breaks the engine, crashes until you put them all back.

- I played a chapter of The Lion Throne and saved my game. After this, my DEBUG level kept crashing the game. However, I had also created a TileData.png for the first time before this, and my MapSprite.png file got deleted, so it could have been that crashing it as well.

Edited by Itshinka

Share this post


Link to post
Share on other sites
On 1/31/2020 at 12:55 AM, Ashai said:

Way back when I asked this, I thought it was intentional that the title screen was playing Helms Deep - Start/Loop at a slower rate, but it seems that this is tied to the audio sample rate of the file itself. Helms Deep has a sample rate of 48.000 kHz, so it is playing slower than it should be.

You can see this happening with Midna's Theme as well because it has the same sample rate.
But if you try something else with a sample rate of 44.000 kHz, like Awakening - Easy Now, you can hear the song play at a normal speed.

Interesting. I didn't notice that I had two different sample rates of music included. I'm probably not going to fix it as it stands, because I'm not really updating The Lion Throne as a game anymore, and a slight speed decrease and pitch shift is not that big a deal, but its good to know. For future work, I guess 44.1 kHz is the correct sample rate to use.

31 minutes ago, Itshinka said:

Just some issues I had with the engine that I put on the GitLab issues page, thought I might post them here as well.

Thanks for mentioning it here. I don't check the engine page very often, so your issue could have languished for quite a while.

32 minutes ago, Itshinka said:

- Whenever you open the editor, the MapSprite.png file is overwritten with a blank one, and you have to constantly call for the file again. Additionally, if you have a TileData.png made and you're working on it with that map, saving the tiledata deletes the MapSprite again. This makes it practically impossible to work on anything without constantly making copies of your TileData, which gets deleted everytime you re-import your MapSprite.

I have never gotten these errors and cannot recreate it myself. I don't even know how this would occur. I don't think the editor even has the capacity to create a blank MapSprite.png. Has anyone else whose used the editor ever experienced an error like this? If you or anyone else can recreate this error in a few well-defined steps, that would really help me find it.

33 minutes ago, Itshinka said:

- Additionally, copying the tutorial and deleting all The Lion Throne characters breaks the engine, crashes until you put them all back.

It is the case that deleting a character that a level is using would cause the editor to crash when it tries to open that level. I've fixed the editor to now just ignore characters/units and classes that aren't defined anymore (except "Citizen" class, since that is the default class). It's updated on the Git repo and I'll have an executable update in a couple of days. I've not seen an error at all in the Engine proper. Just to check, I deleted EVERY unit in the units.xml and played the current DEBUG level and The Lion Throne prologue, and no errors occurred -- besides like the prologue making no sense because Ophie and Prim never show up.

 

Share this post


Link to post
Share on other sites
1 hour ago, rainlash said:

Interesting. I didn't notice that I had two different sample rates of music included. I'm probably not going to fix it as it stands, because I'm not really updating The Lion Throne as a game anymore, and a slight speed decrease and pitch shift is not that big a deal, but its good to know. For future work, I guess 44.1 kHz is the correct sample rate to use.

Thanks for mentioning it here. I don't check the engine page very often, so your issue could have languished for quite a while.

I have never gotten these errors and cannot recreate it myself. I don't even know how this would occur. I don't think the editor even has the capacity to create a blank MapSprite.png. Has anyone else whose used the editor ever experienced an error like this? If you or anyone else can recreate this error in a few well-defined steps, that would really help me find it.

It is the case that deleting a character that a level is using would cause the editor to crash when it tries to open that level. I've fixed the editor to now just ignore characters/units and classes that aren't defined anymore (except "Citizen" class, since that is the default class). It's updated on the Git repo and I'll have an executable update in a couple of days. I've not seen an error at all in the Engine proper. Just to check, I deleted EVERY unit in the units.xml and played the current DEBUG level and The Lion Throne prologue, and no errors occurred -- besides like the prologue making no sense because Ophie and Prim never show up.

 

I have attached screenshots of my documentation of the events.

 

I will begin to explain them here.

Image 1 - All the files as they should be, with the original source map and the correct MapSprite, after having imported it. Note that TileData is empty for the sake of doing this quickly. If MapSprite is lost, then TileData defaults to all Plains as well.

Image 2 - I saved, and then closed the program. I was prompted to save, discard, or cancel. I selected save, and my MapSprite was lost.

Image 3 - I reopened the editor and re-imported the map.

Image 4 - I saved and closed the program again, this time pressing Discard when it asked me to save, discard, or cancel. MapSprite stayed intact this time.

Image 5 (accidentally named image 6) - I opened the program again and saved before importing my map. The MapSprite became blank after doing this.

I attached an image of the Properties of MapSprite.png after it was cleared.

Finally I attached a folder named "The Files", containing all the files as they were in Image 5.

 

 

Edit: I have reached the max number of posts per day, so I will post any follow ups in the form of edits to this post or on GitLab.

Lex.rar

Edited by Itshinka

Share this post


Link to post
Share on other sites

Not sure if this is where you post general questions for help with creating new materials in the data of the engine, but I figured this was as good a place as any.

To summarize my goal as succinctly as possible, my goal is to recreate the Resolve skill in Rex. Obviously, Resolve gives +50% STR, SKL and SPD when at half health or lower. As best as I can tell, in my admittedly very limited experience, all of the pieces exist required to do so, but I seem to be lacking in my ability to execute on the idea. I can create a skill that provides the boost to the skills all the time quite easily, and the conditional ability to grant conditional stats while at half health also exists (as per Futuresight). Is there a command to have the game grant conditional_stat_change or something similar? Can such a feat be done by granting an invisible aura or buff, perhaps, as a workaround? And how would I make the stat changes disappear if the unit is healed above the threshold, were the workaround the only option?

Thanks in advance.

Share this post


Link to post
Share on other sites
On 2/2/2020 at 3:29 PM, Itshinka said:

I have attached screenshots of my documentation of the events.

Thanks for the screenshots! I took a look and tried to recreate the events, but I don't get that weird empty MapSprite.png file that you get -- There must be something else to the problem. My expectation is that the image is somehow not defined in the editor and its saving a null image (which should break, but isn't). I've added some more error checking and moved around some of how the map sprite is saved in the latest update to the git repo. Can you pull the changes and try again? Tell me if the error continues...

 

 

On 2/2/2020 at 4:36 PM, AtunaLemep said:

Not sure if this is where you post general questions for help with creating new materials in the data of the engine, but I figured this was as good a place as any.

To summarize my goal as succinctly as possible, my goal is to recreate the Resolve skill in Rex. Obviously, Resolve gives +50% STR, SKL and SPD when at half health or lower. As best as I can tell, in my admittedly very limited experience, all of the pieces exist required to do so, but I seem to be lacking in my ability to execute on the idea. I can create a skill that provides the boost to the skills all the time quite easily, and the conditional ability to grant conditional stats while at half health also exists (as per Futuresight). Is there a command to have the game grant conditional_stat_change or something similar? Can such a feat be done by granting an invisible aura or buff, perhaps, as a workaround? And how would I make the stat changes disappear if the unit is healed above the threshold, were the workaround the only option?

Yeah, this is fine. You can also PM me if you wish.

So, I thought about it for a while and I think its not possible to literally change the STR, SKL, and SPD by 1.5x of a unit, only when their HP is <= 50%. There is no conditional status effects -- but I should that ability, since it seems to be wanted by more than one user -- so you can't have a conditional status effect that gives out those changes. Even if you could, there's no fractional changes to stats available.

So, I would recommend a slightly different approach, to accomplish the same thing gameplay wise. 

    <status name="Resolve">
        <id>Resolve</id>
        <image_index>8,8</image_index>
        <desc>Grants effective STR, SKL, and SPD 1.5x if HP is under half.</desc>
        <components>mt,avoid,hit,attackspeed,crit,class_skill</components>

        <!-- Add STR/2 to mt, so you effectively hit for STR/2 extra damage -->
        <mt>self.stats['STR'].base_stat//2 if self.currenthp &lt;= self.stats['HP']/2. and item and not item.is_magic() else 0</mt>
        <!-- Add SKL/2 to hit, so you effectively have SKL extra accuracy (assuming Accuracy = SKL*2 normally) -->
        <hit>(self.stats['SKL'].base_stat//2)*2 if self.currenthp &lt;= self.stats['HP']/2. else 0</hit>
        <!-- Add SPD/2 to avoid, so you effectively have SPD extra avoid (assuming Avoid = SPD*2 normally) -->
        <avoid>(self.stats['SPD'].base_stat//2)*2 if self.currenthp &lt;= self.stats['HP']/2. else 0</avoid>
        <!-- Add SPD/2 to attackspeed, so you effectivly have SPD/2 extra attackspeed -->
        <attackspeed>self.stats['SPD'].base_stat//2 if self.currenthp &lt;= self.stats['HP']/2. else 0</attackspeed>
        <!-- Add SKL/2 to crit, so you effectively have SKL/4 extra crit (assuming Crit Rate = SKL/2 normally) -->
        <crit>(self.stats['SKL'].base_stat//4 if self.currenthp &lt;= self.stats['HP']/2. else 0</crit>
    </status>

It's complicated, but it basically does what you want, without actually messing with the stat values themselves. There will be weird issues if you use a weapon that is not magical and also doesn't use STR for damage, but otherwise, this should do what you want. 

Share this post


Link to post
Share on other sites

What an incredibly intuitive workaround. I'll test it immediately.

I'll be sure to Pm if I have future further questions. Undoubtedly I will. Thanks for all your hard work, friend.

Share this post


Link to post
Share on other sites

There are times in GBA FE where dialogue can pause for a time before autoadvancing.  Could that also be implemented here, a sort of timed wait where the dialogue pauses and it continues not after pressing A but instead after a set amount of time?  There were a few instances in Absolution where the dialogue went by too fast because there was no pause, and I think they could benefit the most from autoadvancing.

Share this post


Link to post
Share on other sites

I pulled the new version today and it still generates an empty SpriteMap.png if I don't import map every time I open the program. (Had to focus on school work for a few days.)

Share this post


Link to post
Share on other sites
13 hours ago, BBHood217 said:

There are times in GBA FE where dialogue can pause for a time before autoadvancing.  Could that also be implemented here, a sort of timed wait where the dialogue pauses and it continues not after pressing A but instead after a set amount of time?  There were a few instances in Absolution where the dialogue went by too fast because there was no pause, and I think they could benefit the most from autoadvancing.

I could add this feature, but I would need to understand more about what you would want it to do. I assume you would want a command in the dialogue that would make it wait, but for how long? Should the length be dependent on the amount of text before it? Should pressing "A" move past the wait anyway? Should pressing "Start" move past the wait? If you have a video of an example from the GBA for me to model it on, that would be helpful.

I think it's likely that Absolution just had too many characters in a row without a "{w}{br}" that two lines of text can't fit. Unfortunately, there's no easy way to detect this except running through the dialogue manually. 

 

On 2/3/2020 at 6:32 PM, rainlash said:

So, I would recommend a slightly different approach, to accomplish the same thing gameplay wise.

Slight error here but I can't edit the post anymore. To get the crit section to work, you'll need to change all instances of "crit" component to "crit_hit" component. There is no "crit" component.

 

5 hours ago, Itshinka said:

I pulled the new version today and it still generates an empty SpriteMap.png if I don't import map every time I open the program. (Had to focus on school work for a few days.)

I have a new version of the git repo uploaded. Can you try doing the same thing again, but this time if it doesn't work, can you send me a screenshot of what the editor prints to the screen. Essentially, send me the text that follows this:

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
Debug: 1
ERROR! No words.txt file found in the data directory.
Version: v0.9.3.13

Also, I updated the code so that if you "Import New Map" a map that has the same size as the currently displaying map, it will not overwrite your TileData. Hopefully this is a small amount of help while we try to figure out the big problem.

Recently, I opened your map image in GIMP and it told me that the image has an embedded color profile. I doubt that's the problem (since I was able to use your image just fine as is), but can you make a version of your map image without the embedded color profile and also without any alpha (transparency) and try using that instead? You should be able to do that in GIMP or in Photoshop. If you don't have either of these, maybe try saving it as a new file in Paint?

Share this post


Link to post
Share on other sites
8 hours ago, rainlash said:

If you have a video of an example from the GBA for me to model it on, that would be helpful.

The easiest demonstration of what I mean is in FE7, specifically the cutscene after getting Durandal and the ending.  In them, the text advances all by itself (agonizingly slowly, I might add) and pressing A doesn't do anything; when it reaches the end of a line, there's no prompt but a short delay before the dialogue continues on its own.  That's what I want implemented.

Share this post


Link to post
Share on other sites

So I been working with the engine for some time. I like it and I am impressed. However I have 2 issues. First is that when I try to have reinforcements enter on turn 2 the game crashes. I added a snap shot of the debug report. I followed the Wiki on Gitlab, but it still crashes. I would really appreciate some help if possible. My second Issue is just that I can't figure out how to give my units custom color palettes for battle animations. 

Error.PNG

turnChangeScript.txt

Share this post


Link to post
Share on other sites
12 hours ago, AnimusTheSpirit said:

So I been working with the engine for some time. I like it and I am impressed. However I have 2 issues. First is that when I try to have reinforcements enter on turn 2 the game crashes. I added a snap shot of the debug report. I followed the Wiki on Gitlab, but it still crashes. I would really appreciate some help if possible. My second Issue is just that I can't figure out how to give my units custom color palettes for battle animations. 

What version of the Engine are you using? Because if you are using a very old version of the Engine, I could see you running into an issue like this.

Assuming you're running a new-ish version though, then the issue with "triggers" is that they are just not very well implemented right now. I would recommend not using them -- just use the "add_unit" and "move_unit" commands. I know its a more work on your end, but it's not buggy and gives you a bit more fine-tuned control over reinforcement placement. "Triggers" are kind of relic of an older method and really shouldn't be used any more. I need to hurry up and remove them, honestly...

Just turn your units into reinforcements and, in your turn change script, call "add_unit;reinforcement_event_id;starting_position" and "move_unit;reinforcement_event_id;position_i_want_to_move_to". The italicized sections get replaced of course. This is what I did for every reinforcement in the Lion Throne, so I know it works well. It is explained somewhat in https://gitlab.com/rainlash/lex-talionis/-/wikis/15.-Reinforcements "Using the Reinforcement Menu without Triggers" section of the wiki. You can also take a look at how I implemented reinforcement events scripts in many of the chapters of the Lion Throne.

PM me if you have any issues with this.

 

For the custom color palettes in battle animations, I would hope that its pretty straightforward. If you still have the animation files that came with the Lion Throne, you can look at (for instance), the /Data/Animations/Knight folder to see how custom color palettes are added. For each animation: "Lance", "RangedLance", and "Unarmed", there are four image files, one for each of the color palettes I use. There's always "GenericBlue" and "GenericRed" images, which are the fallback color palette options for player characters and enemy characters if there is no custom color palette defined. But then there's the "Harold" and "Theo" images, which are how I have custom palettes for those two characters. Instead of using the normal image in engine, any Knight with the unit id of "Harold" will use the "Harold" image. Does that make sense? To make your own, just (1) open, for instance, "Knight0-Lance-GenericBlue.png" in Paint or GIMP or Photoshop, (2) swap the colors, (3) and rename it "Knight0-Lance-Winston.png" (if your character were named Winston). Now, as long as your character Winston is a Knight, is using a Lance in melee range, and has the unit id "Winston", they will use that color animation.

Share this post


Link to post
Share on other sites
16 minutes ago, rainlash said:

What version of the Engine are you using? Because if you are using a very old version of the Engine, I could see you running into an issue like this.

Assuming you're running a new-ish version though, then the issue with "triggers" is that they are just not very well implemented right now. I would recommend not using them -- just use the "add_unit" and "move_unit" commands. I know its a more work on your end, but it's not buggy and gives you a bit more fine-tuned control over reinforcement placement. "Triggers" are kind of relic of an older method and really shouldn't be used any more. I need to hurry up and remove them, honestly...

Just turn your units into reinforcements and, in your turn change script, call "add_unit;reinforcement_event_id;starting_position" and "move_unit;reinforcement_event_id;position_i_want_to_move_to". The italicized sections get replaced of course. This is what I did for every reinforcement in the Lion Throne, so I know it works well. It is explained somewhat in https://gitlab.com/rainlash/lex-talionis/-/wikis/15.-Reinforcements "Using the Reinforcement Menu without Triggers" section of the wiki. You can also take a look at how I implemented reinforcement events scripts in many of the chapters of the Lion Throne.

PM me if you have any issues with this.

 

For the custom color palettes in battle animations, I would hope that its pretty straightforward. If you still have the animation files that came with the Lion Throne, you can look at (for instance), the /Data/Animations/Knight folder to see how custom color palettes are added. For each animation: "Lance", "RangedLance", and "Unarmed", there are four image files, one for each of the color palettes I use. There's always "GenericBlue" and "GenericRed" images, which are the fallback color palette options for player characters and enemy characters if there is no custom color palette defined. But then there's the "Harold" and "Theo" images, which are how I have custom palettes for those two characters. Instead of using the normal image in engine, any Knight with the unit id of "Harold" will use the "Harold" image. Does that make sense? To make your own, just (1) open, for instance, "Knight0-Lance-GenericBlue.png" in Paint or GIMP or Photoshop, (2) swap the colors, (3) and rename it "Knight0-Lance-Winston.png" (if your character were named Winston). Now, as long as your character Winston is a Knight, is using a Lance in melee range, and has the unit id "Winston", they will use that color animation.

Thanks man! I updated my engine and it fixed perfectly. As for the colors, its only after I posted it that I noticed characters had their own separate sprite sheets ^_^;. I was using FEXP before moving to this so I assumed it was handled the same way. But with that I have no issues, other than just spelling errors in my coding. I might post a playable demo of my game sometime in the future. I have most of the story for the beginning done, from when I was working in FEXP. Now its just porting everything over.

Share this post


Link to post
Share on other sites

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.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...