Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
SRB2
SRB2
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 246
    • Issues 246
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 71
    • Merge Requests 71
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • STJr
  • SRB2SRB2
  • Merge Requests
  • !1067

Closed
Opened Jul 15, 2020 by Monster Iestyn@MonsterIestyn 
  • Report abuse
Report abuse

WIP: SOC/Lua freeslot parser fixes

This branch adds fixes related to parsing freeslots from SOC and Lua. Most notably, you can no longer create two or more freeslots with the same name; if you attempt to do this (by accident usually), a warning about it will be printed in the console. (Note that in Lua, this does not break hooks unlike typical Lua errors, it just moves on to the next freeslot as expected.)

This is currently WIP because I think there were changes I intended to make before making this MR, though I forget what they were right now.

×

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b parser-fixes origin/parser-fixes

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git checkout next
git merge --no-ff parser-fixes

Step 4. Push the result of the merge to GitLab

git push origin next

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 4
  • Commits 6
  • Changes 2
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Zolton Auburn @Zippy_Zolton commented Jul 18, 2020

    I thought freeslotting the same name would just not do anything

    I thought freeslotting the same name would just not do anything
  • Kays Ishaq @kays commented Jul 18, 2020

    Maybe out of the scope of this MR, just thinking out loud - but Lua should probably push nil if a freeslot fails for whatever reason. Or maybe push the existing value if it already exists. As it is now, if you had local myobject, mystate, mysfx = freeslot("MT_MYOBJECT", "S_MYSTATE", "sfx_mysfx") and it failed to freeslot the state, mystate would store the value pushed for sfx_mysfx, no?

    Maybe out of the scope of this MR, just thinking out loud - but Lua should probably push nil if a freeslot fails for whatever reason. Or maybe push the existing value if it already exists. As it is now, if you had `local myobject, mystate, mysfx = freeslot("MT_MYOBJECT", "S_MYSTATE", "sfx_mysfx")` and it failed to freeslot the state, `mystate` would store the value pushed for `sfx_mysfx`, no?
  • Monster Iestyn @MonsterIestyn commented Jul 18, 2020
    Master

    Kays: I had thought about that, yeah. It would just need to explcitly push nil and count them in the results count (which is what pushes them to the Lua stack and gives the results to the variables in the script, or something like that).

    Zolton Auburn: That's mostly true, except when it comes to sprites. IIRC people in the past have encountered weird errors when they accidentally freeslot a sprite in both Lua and SOC. Because of the !sprnames[j][4] thing in particular, the original sprite slot becomes inaccessible. Any time you'd refer to the sprite name always refers to the newest sprite slot instead!

    Apart from that though, we've been meaning to make the game report when you duplicate freeslot resources for ages now. I've just been distracted by many other things over the years.

    Kays: I had thought about that, yeah. It would just need to explcitly push nil and count them in the results count (which is what pushes them to the Lua stack and gives the results to the variables in the script, or something like that). Zolton Auburn: That's mostly true, except when it comes to sprites. IIRC people in the past have encountered weird errors when they accidentally freeslot a sprite in both Lua and SOC. Because of the `!sprnames[j][4]` thing in particular, the original sprite slot becomes inaccessible. Any time you'd refer to the sprite name always refers to the newest sprite slot instead! Apart from that though, we've been meaning to make the game report when you duplicate freeslot resources for ages now. I've just been distracted by many other things over the years.
  • Monster Iestyn @MonsterIestyn

    added 783 commits

    • 72dc2462...3e02f5d0 - 782 commits from branch next
    • 6191041a - Merge branch 'next' into parser-fixes

    Compare with previous version

    Aug 10, 2020

    added 783 commits

    • 72dc2462...3e02f5d0 - 782 commits from branch next
    • 6191041a - Merge branch 'next' into parser-fixes

    Compare with previous version

    added 783 commits <ul><li>72dc2462...3e02f5d0 - 782 commits from branch <code>next</code></li><li>6191041a - Merge branch &#39;next&#39; into parser-fixes</li></ul> [Compare with previous version](https://git.magicalgirl.moe/STJr/SRB2/merge_requests/1067/diffs?diff_id=6127&start_sha=72dc2462f42862ef4285ce30d86dabd0fb407775)
    Toggle commit list
  • Monster Iestyn @MonsterIestyn commented Dec 16, 2020
    Master

    Since everyone including me has forgotten about this MR, and !1222 (merged) has already been accepted since a month ago, and I don't seem to have much motivation to work on this or anything SRB2 lately, perhaps its best if someone else can recreate these fixes with the new files and figure out what I forgot to do (I know I forgot to do something but can't recall what offhand).

    Since everyone including me has forgotten about this MR, and !1222 has already been accepted since a month ago, and I don't seem to have much motivation to work on this or anything SRB2 lately, perhaps its best if someone else can recreate these fixes with the new files and figure out what I forgot to do (I know I forgot to do *something* but can't recall what offhand).
  • Monster Iestyn @MonsterIestyn

    closed

    Dec 16, 2020

    closed

    closed
    Toggle commit list
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
3
Labels
Bugs Enhancement Lua
Assign labels
  • View project labels
Reference: STJr/SRB2!1067