First of all, congrats for Skookumscript! It’s been a lot of fun to use it since I felt comfortable enough with the syntax, API bindings etc to try it here in a sandbox project I have set up in UE4. I’m really happy with its language features, design ideas etc. Specially coroutines (and being able to use _wait(xx frames or seconds) at will, to relieve gameplay code processing, and also being able to issue commands/code snippets while the game is running. This is mind blowing for iterating on the scripts, fixing it, prototyping. For me it feels like the next step in scripting for realtime stuff.
Also the way the IDE and script files are structured: separating each function in its own page. Scrolling through huge class implementation pages can be a bit boring, even with icons for collapsing code blocks. So, thumbs up again. I decided two days ago that certainly I’m gonna use skookumscript for my game. I like blueprints, its right-click searching that tries to match results is great etc, but when the graphs get too complex, its just not intuitive to browse them. Too much zooming in and out, panning to follow the execution line/flow.
Ok, enough of praising. My question:
I’m trying to change/update the value of a member variable (ex: “@distance_to_target”) inside of a coroutine through an argument, but it’s failing to change it. I’ve read in some answers that by default arguments are passed into methods and coroutines by reference, so I don’t understand why they’re not being changed.
I have this data member, @distance_to_target.
I havea coroutine called ‘brake_cable_lift’. // I removed the underscore in it here because the post tool was messing it
In its implementation page, it has
(Real distance_to_target, Actor destination_point)
distance_to_target := distance_to(destination_point)
- But when I try to use @distance_to_target again, outside and after the coroutine call, but in the same page/script as the call (the script is a coroutine called “_update”, with a loop), I notice that @distance_to_target didn’t get updated.
Shouldn’t it have updated, as it is passed by reference into the coroutine?
(*I tried using a return argument, but when I put the ; before it, inside the parentheses, the Erros window in the IDe say something like “Tried to find an expression but didn’t find one”.
Any help will be greatly appreciated. I’m starting to learn the language, script some gameplay stuff to exercise (lifts, doors etc), so sorry if the question is too dumb.This text will be hidden