Glad to hear that you are enjoying SkookumScript!
@distance_to_target a "raw" data member? Was it created via Blueprints (raw) or via SkookumScript (not raw)?
If it is a raw data member then it is actually a function call that looks like a data member - just for convenience. Due to this, there are some limitations compared to non-raw data members - such as being able to pass it by reference. Whenever it is used it creates a brand new object so any changes to that object will not go back unless it is reassigned to the raw data member again. This raw data members should be highlighted in the IDE so they stand out more and it needs to be documented more in the manual. They can be quite handy when they work though.
Here is some additional info:
Looking at your
brake_cable_lift(), could you just return the result as a primary return?
(Actor destination_point) Real
// return distance as result
// last expression is always returned from a code block
You would call it with something like this:
If I understand your question properly, just returning the result as above is probably best. Though if you did want to use a return argument, this is how you would go about it:
(Actor destination_point; Real distance_to_target)
// Bind `distance_to_target` to distance before routine completes
You would call it with something like:
Or declare the variable right in the return argument slot:
You can find out more about using return argumentshttp://skookumscript.com/docs/v3.0/#return-arguments in the Primer in the SkookumScript online docs. This just talks about using them not actually how to put them in routines like I did above.
Good luck and please spread the word about SkookumScript!
Here are some tips for putting code in forum posts: