Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix and Update Unreal Plugin for UE 5 #49

Merged
merged 69 commits into from
Sep 21, 2023
Merged

Fix and Update Unreal Plugin for UE 5 #49

merged 69 commits into from
Sep 21, 2023

Conversation

JBenda
Copy link
Owner

@JBenda JBenda commented Jul 20, 2022

Inkcpp got many new features which are not mirrored in the Unreal Plugin. On top, many small name clashes with UE5 exists.

  • apply changes from Fix Unreal Build and 4.26 Compatibility #35
  • Fix compiler errors
  • adopt all output functions to basic_stream::get() atoutput.cpp:142
  • loading .ink files directly
  • revisit Plugin Design to introduce new concepts and use UE5 Nodes system
    • Snapshot store and load
    • read and modify lists variables
  • merging pending PRs

@JBenda

This comment was marked as outdated.

JBenda and others added 27 commits July 31, 2022 11:58
+ reset tags for unreal getline to keep tags line dependent
based on:
https://github.com/inkle/ink/blob/master/Documentation/RunningYourInk.md#fallbacks-for-external-functions

it is no possible to implement a dummey/error function for each external
functions. It must have ben the same name and same amount of arguments
and will be executed if the external functio was not bind when needed.
IF the external functions will get bind later, then it will be called
the next time.

Introduces new flag: "FALLBACK_FUNCTION" to add a new execution
dimension
Introduce new value type: `ex_fn_not_found` to signal failed excetrnal
executio
@JBenda
Copy link
Owner Author

JBenda commented Sep 20, 2022

So the unreal plugin is reworked:

  • adapted to UE5, but should also work with UE4.27 (not tested)
  • added an example level + assets (contained in attachments)

Last Update: 20.09.2022

Please don't hesitate to test it and provide feedback :)

Instructions:

  1. create an unreal project and close it
  2. not down path to unreal project (PATH/TO/UNERAL_PROJECT) e.g. D:\Dokumente\Unreal Projects\InkDemo
  3. git clone --branch feature/Unreal_fixes https://github.com/JBenda/inkcpp.git
  4. cd inkcpp
  5. mkdir build
  6. mkdir plugin
  7. cd build
  8. cmake -DCMAKE_INSTALL_PREFIX=../plugin ..
  9. cmake --install . --component unreal
  10. compile plugin:
    \PATH\TO\UNREAL_ENGINE\Build\BatchFiles\RunUAT.bat BuildPlugin -plugin="PATH\TO\GIT\REPO\plugin\inkcpp\inkcpp.uplugin" -package="\PATH\TO\UNERAL_PROJECT\Plugins\inkcpp" -TargetPlatforms=Win64
  11. Copy content of the InkUnrealExample in PATH\TO\UNREAL_PROJECT\Content
    grafik
  12. Start unreal project
  13. Select Level NewMap from the Content Drawer
  14. start level, for the control use the 1,2,3 and 4 Key to select the corresponding choice
  • in the main world is a MyInkRuntime instance which takes a InkAsset for the story to play
    • unreal_example shows different kind of interaction between engine and ink
    • TheInterceptor is a larger example story from ink
  • to create a InkAsset import a .ink. file or an inklecate compiled .json ← we will probably not in future keep high priority on json imports ...

A Record of the terminal side of the build process can be found here
Example Data

@sinbad
Copy link

sinbad commented Oct 5, 2022

I'm just checking this PR out because I'm investigating Ink in UE5, but I think the attachment for "InkUnrealExample" is missing?

@sandiz
Copy link

sandiz commented Jun 23, 2023

ink compiler 1.1.1 is no longer able to compile TagsStory.ink / all tags tests are failing as inklecate is not able to compile ink files.

This might be because of dynamic tag introduction -- RELEASE

image

/Users/sandi/Projects/inkcpp/cmake-build-release/inkcpp_test/inkcpp_test -r xml -d yes --order lex
Testing started at 2:29 AM ...

/Users/sandi/Projects/inkcpp/inkcpp_test/Tags.cpp:145: Failure:
due to unexpected exception with message:
  Diverting past end of story data!




ERROR: 'TagsStory.ink' line 9: Expected end of line but saw '# choice_tag_b'
ERROR: 'TagsStory.ink' line 21: Expected end of line but saw '# close_tag'

/Users/sandi/Projects/inkcpp/inkcpp_test/Tags.cpp:46: Failure:
due to unexpected exception with message:
  Inklecate failed with exit code 256



/Users/sandi/Projects/inkcpp/inkcpp_test/Tags.cpp:31: Failure:
due to unexpected exception with message:
  Unrecognized command!


/Users/sandi/Projects/inkcpp/inkcpp_test/Tags.cpp:179: Failure:
due to unexpected exception with message:
  Unrecognized command!


Process finished with exit code 4

Any pointers on how to fix this ?

@JBenda
Copy link
Owner Author

JBenda commented Jun 23, 2023

Looks like they changed the syntax. It seems the tag must now be in front of the jump.
I will take a deeper look on Monday.

+ Hey # choice_tag
   -> knot2

@JBenda
Copy link
Owner Author

JBenda commented Jun 26, 2023

The notation with * [b # choice_tag_b]->knot2 results in the expected output for inky. Sadly, it also introduced a new tag, which is not yet supported by us. But WIP ^^

@JBenda
Copy link
Owner Author

JBenda commented Jun 26, 2023

TagsStory.ink is now updated and the c++ part also supports now tag annotate choice (see choice::get_tag(size_t))

@sandiz
Copy link

sandiz commented Jun 27, 2023

Thanks so much for pushing a fix @JBenda 🙏 🎉 , i'll test this soonish™ and get back!
is there a patreon or github sponsor option available ? would love to support you guys! ❤️

@sandiz
Copy link

sandiz commented Jun 28, 2023

tested on mac / windows - inkcpp is working correctly (cpp library) with latest inklecate v1.1.1

@JBenda
Copy link
Owner Author

JBenda commented Jul 4, 2023

Thanks so much for pushing a fix @JBenda pray tada , i'll test this soonish™ and get back! is there a patreon or github sponsor option available ? would love to support you guys! heart

There is no inkcpp patreon, but please don't hesitate to use GitHub sponsoring

@JBenda JBenda marked this pull request as ready for review September 21, 2023 08:33
@JBenda JBenda merged commit 705822e into JBenda:master Sep 21, 2023
5 checks passed
@JBenda JBenda deleted the feature/Unreal_fixes branch September 21, 2023 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants