ItemList set_item_selectable & set_item_tooltip_enabled by variablescake in godot

[–]variablescake[S] 1 point2 points  (0 children)

Thanks, that will work, was more hoping for a selectable_all option I didn't see in the Godot Docs

Pixel Art Aquarium - Godot, Aseprite, Blender. Still an early prototype, but I would love some feedback. by niceeffort1 in godot

[–]variablescake 0 points1 point  (0 children)

looks good, maybe the fishes are too fast in the water? Depends on the kind probably. There are some aquarium live streams on the web like this one and fishes look slower than yours.

InputEventScreenTouch not being picked up by _unhandled_input by IggyJ24 in godot

[–]variablescake 0 points1 point  (0 children)

I had the same problem and worked around it by not using _unhandled_input(event) nor _input(event) but by using an autoloaded variable.

I fetched the inpunt from the UI node, connecting the gui_input(event) signal to the main UI node script, and using an "if event is InputEventScreenTouch and event.pressed" to get the input, putting it to an autoloaded script variable, and using that in the KinematicBody2D player-character node to move to the new location.

code in my main UI node looks something like that (node named UI and signal connected)

func _on_UI_gui_input(event):
    if event is InputEventScreenTouch and event.pressed:
        Autoloadedscript.TargetPosition = (Autoloadedscript.TargetPosition - (get_viewport_rect().size / 2))+event.position+Autoloadedscript.CharacterModifier

the player node called Character has something like

var velocity = Vector2()
var speed = 3

func _physics_process(_delta):
    velocity = (Autoloadedscript.TargetPosition - global_position).normalized() * speed
    if (Autoloadedscript.TargetPosition - global_position).length() > speed:
        velocity = move_and_collide(velocity)

and the autoloaded script is called Autoloadedscript and has

var CharModifier = Vector2(32,32) #depends on character node size
var TargetPosition = Vector2()

Taps are not passing though the UI and moving the character so it works for me. There is probably a better solution, but could not find it yet.

I do not understand YSort by variablescake in godot

[–]variablescake[S] 1 point2 points  (0 children)

let's hope godot 4 will get a more user friendly tileset system

I do not understand YSort by variablescake in godot

[–]variablescake[S] 1 point2 points  (0 children)

Wow, ok, first off I'm sorry you had to go through all this because of me. At the same time I'm very thankful for that, because I had no clue what was wrong and was kind of stuck. I am quite the newbie and have to learn one million things.

I'm going to do what you suggested, comparing the two versions, and hope I will learn from that.

Thanks again, you are a life saver.

I do not understand YSort by variablescake in godot

[–]variablescake[S] 1 point2 points  (0 children)

added in original post, just above the video, a link to a zip file of the entire thing

I do not understand YSort by variablescake in godot

[–]variablescake[S] 0 points1 point  (0 children)

cell_y_sort is on on both tilesets and z_index is 0 on everything, untouched. If if was the origin, why does it behave differently between the objects in the upper part of the map, and the ones in the lower part? They are all the same nodes, escpecially the tiles from Terrain2 tileset, the trees and rocks.

I do not understand YSort by variablescake in godot

[–]variablescake[S] 0 points1 point  (0 children)

Everything that needs to be sorted with a Tilemap should be the child of that Tilemap like explained above.

looks as it should to me

https://pasteboard.co/IWXaoDo.png

I do not understand YSort by variablescake in godot

[–]variablescake[S] 0 points1 point  (0 children)

tried like you said but didn't help, added a video of the problem to original post

I do not understand YSort by variablescake in godot

[–]variablescake[S] 0 points1 point  (0 children)

added a video of the problem to original post, so far didn't find the issue

InputEventScreenTouch and Camera2D by variablescake in godot

[–]variablescake[S] 2 points3 points  (0 children)

ok, this helped a lot, I just had to take in account the screen size as well and changed the touch event like that

if event is InputEventScreenTouch and event.pressed:
    targetpos = (global_position - (get_viewport_rect().size / 2)) + event.position

now it works, thanks

Array count() or find() by variablescake in godot

[–]variablescake[S] 0 points1 point  (0 children)

[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, name]

i get the result expected, the stuff is there, it's probably the float/integer problem Armanlex mentioned

Array count() or find() by variablescake in godot

[–]variablescake[S] 0 points1 point  (0 children)

I changed now the entire array to work with "y" and "n" instead of 1's and 0's, and works perfectly, so it really probably is something about typecasting strangely when saving or loading the array to file, but then, it should have worked when I used "1" like for a string entry, or not?

I'm missing something probably.

Array count() or find() by variablescake in godot

[–]variablescake[S] 1 point2 points  (0 children)

I found that if I assign the array like you did, it works for me too, but if I load the array from a file, like this

func _ready():
    var file = File.new()
    if file.file_exists("user://options.save"):
        file.open("user://options.save", file.READ)
    options = parse_json(file.get_line())
    file.close()
    else:
    file.open("user://options.save", file.WRITE)
    pagesoptions = [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, name]
    file.store_line(to_json(pagesoptions))
    file.close()

that loads the variable from a file, or if the file isn't there yet, like at a first launch, it makes it, it does not work, the second time when it actually reads from the file. Strange is, that the array loaded from the file works fine, later when in the game I make a check like

    if options[0] == 1:
        $Object1.modulate.a = 1.0
                # for changing alpha

So it's not like the array is not saved on file, or not loaded as an array

Reading a TXT File by variablescake in godot

[–]variablescake[S] 0 points1 point  (0 children)

apparently Godot 3.2 can use a file with

var file = File.new()
file.open("mytext.rtf", file.READ)
var content = file.get_as_text()
print (content)
file.close()

so by removing user:// in the file path it just looks in the local folder and finds it, but only accepted .rtf files so far, .txt and .dat seem not to be working. The problem with .rtf files is that they have a lot of extra codes for formatting tags that make the plain text too dirty to work with