RhenaudTheLukark / CreateYourFrisk

Rhenaud The Lukark's Unitale fork
GNU General Public License v3.0
133 stars 56 forks source link

Using a [func] call using BattleDialog in the EncounterStarting() function crashes the Encounter #19

Closed RhenaudTheLukark closed 6 years ago

RhenaudTheLukark commented 6 years ago

Describe the bug Read the title

To Reproduce Steps to reproduce the behavior:

  1. Paste this in an encounter:
    
    function EncounterStarting()
    BattleDialog({"TestText. Possible error incoming", "[func:a]"})
    end

function a() DEBUG("It works!") end



2. Launch the encounter
3. "Func called but no script to reference it. That's the engine's fault, not yours."

**Expected behavior**
The message "It works!" should appear in the debugger.

**Setup (please complete the following information):**
 - Any, on 0.6.1.2 and 0.6.1.1

**Additional context**
Any use of [func] outside of EncounterStarting() with the function BattleDialog() works like intended. It must likely be a problem of when this link is established.
RhenaudTheLukark commented 6 years ago

The link was indeed established during the first time the State() function was launched, which was not launched before BattleDialog() when used in the function EncounterStarting(). A new version will be released when the current bugs will be solved.