Jump to content
Sign in to follow this  
Fompster

Questions About Scripting

Recommended Posts

Hi I just have a few questions about scripting in Ylands which I couldn't figure out on my own. Maybe some of you have already figured this out.

 

Is there an easier way to add multiple items into an array other than stacking tiles on top of each other like this?

Ylands_190606_233618.thumb.png.7cb35087379b2cefd52df66b24898f28.png

Does it reduce performance or override the storage in any way when I use "add storage" tile on an entity which already has a storage?

And finally is there a way to either change the background or position of the UI within the script itself?

 

Thanks in advance :)

Edited by Fompster_P1

Share this post


Link to post
Share on other sites

Hi, no other option to do it at the moment. However, I agree that it would be useful to have something more user friendly.

Share this post


Link to post
Share on other sites

There's definite pattern there.  Do those array items correspond to entities in the scene?  If so it might be possible to use labels to mark which they should be, and either use those labels to load values into the array, or use the labels to handle the logic where these arrays are used (instead of the arrays).  That would also make it easier to expand or modify the list, even while the game is active.

Share this post


Link to post
Share on other sites
20 hours ago, Houp said:

Hi, no other option to do it at the moment. However, I agree that it would be useful to have something more user friendly.

Id like to suggest something for this, similar to how it works in other languages when you declare an array. One block, that you place your array in and then you can add more slots to add items, you could have a pop up box where you can change the number of items you want to add. Maybe this could work with push and unshift aswell, but even if it was just when declaring an array that would be awesome.
As an added feature, seeing as arrays can only hold items of the same type, if you put a get position block into one of the slots it could place get position blocks into all the other slots or if you put a game logic in one it could make all the others a logic eye dropper.

Hope that made sense?

Share this post


Link to post
Share on other sites
On 6/8/2019 at 2:23 AM, Oliver Hope said:


As an added feature, seeing as arrays can only hold items of the same type, if you put a get position block into one of the slots it could place get position blocks into all the other slots or if you put a game logic in one it could make all the others a logic eye dropper. 

It is possible to populate an array with a mix of Logic Objects and Game Entities.  I have a game mode that I'm testing that does that to generate a list of item spawn locations (reference points and container objects).

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×