EpicSkookumScript / EpicSkookumScript/SkookumScript-Plugin
.do body cannot resolve return parameter
- Dominant language
- C++
- Stars
- 138
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
**UE4 Version**
4.24
**SkookumScript Version**
4.24.03
**Describe the bug**
For the following code that has 2 return parameters, the body of the `do` is unable to see the `intersection` variable. The syntax error is that the identifier does not exist in the current scope.
```javascript
(Transform start_t, Transform end_t; Vector3 plane_normal, Vector3 intersection)
[
plane_normal : Vector3!
intersection : Vector3!
!plane_normals : {end_t.unit_axis_x end_t.unit_axis_y end_t.unit_axis_z}
!dist : 1000.0
// Find X distance
plane_normals.do
[
!end1 : start_t.@translation + [start_t.unit_axis_x * dist]
!end2 : start_t.@translation - [start_t.unit_axis_x * dist]
if MathLib.line_plane_intersection_origin_normal(start_t.@translation,
end1,
end_t.@translation,
item,
0.0,
intersection)
[
println("Plane normal for X is: ", item)
]
else
[
if MathLib.line_plane_intersection_origin_normal(start_t.@translation,
end2,
end_t.@translation,
item,
0.0,
intersection)
[
println("Plane normal for X is: ", item)
]
]
]
]
```
**Expected behavior**
Return parameters should be captured when iterating with `.do`
Contributor guide
Research direction
Reproduce the example in Unreal Engine 4.24 with SkookumScript 4.24.03, then trace how `.do` establishes scope for return parameters. The issue is done when `intersection` resolves inside the `.do` body and the example no longer reports an unknown-identifier syntax error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, unreal-engine
- Domain
- compilers, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100