Godot: VisualScript missing range function / iteration similar to GDScript's

Created on 4 Apr 2019  路  6Comments  路  Source: godotengine/godot

Godot version:
v3.1.stable.official

Issue description:
Visual Script no range how to remove null or one number :(

GDScript:

for x in range(1, 5):

Steps to reproduce:
unknown

archived feature proposal visualscript usability

Most helpful comment

@bojidar-bg these equivalents doesn't seem to be documented anywhere, and are actually quite useful!

All 6 comments

As a workaround until it is fixed:

  • range(5) is equivalent to int(5) when used as an iterator.
  • range(1, 5) is equivalent to Vector2(1, 5) when used as an iterator.
  • range(1, 5, 2) is equivalent to Vector3(1, 5, 2) when used as an iterator.

@bojidar-bg thanks

@bojidar-bg these equivalents doesn't seem to be documented anywhere, and are actually quite useful!

Here is my solution: If you havn't put anything into the condition, it will show a small text that says something like "connect an Array, int or a Vector2", so people who don't know of this behavior have a chance of learning it.

@Jummit I think it would be more useful to either have another node for looping over a range, or a mode which would allow editing the range in-place if no value is connected.

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gonzo191 picture gonzo191  路  3Comments

nunodonato picture nunodonato  路  3Comments

RebelliousX picture RebelliousX  路  3Comments

n-pigeon picture n-pigeon  路  3Comments

timoschwarzer picture timoschwarzer  路  3Comments