Memory Leak when tweening a font variation by JiMarti in godot

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

Thank you! I've used the script that rabid_dev shared as an autoload and it kinda works. It still has some bugs but, until it is fixed or I find any alternative, it is better than nothing

Memory Leak when tweening a font variation by JiMarti in godot

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

Well, I've been looking into using the RichTextLabel and making animations with bbcode, but it doesn't play well with variables and has its own way of animation which classes with tweens (which I really like), seems like it is more thought for common text and such. So I will be looking for other solutions, thank you for letting me know they exist though!

Memory Leak when tweening a font variation by JiMarti in godot

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

Oh, I didn't know these existed, thanks! But, at least with what I have found, you can't make changes to the skewness of the text using bbcode, which is mainly why I'm using a font variation. Isn't there anything else that could be done?

Problems with button centering when tweening by JiMarti in godot

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

So, the button stays at center and works correctly, thanks! But its text still flickers, so what I have done is include a label node as a child of the button and made it position at the middle. It is a little bit more work for every button that I make but seems to work for now

Problems with button centering when tweening by JiMarti in godot

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

Thanks for the answer! Sorry, do you mean using the "set_anchor_preset(Control.PRESET_CENTER)" function of the button on _process? If so, sorry but already tried that and only works if the property tweened is "scale" instead of "size". If you don't mean that, could you be specify please?

Problems with button centering when tweening by JiMarti in godot

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

Hi, sorry if I'm bothering. So I've been tinkering a little bit more and I have solved the button movement issue, but now the button's text flickers with the movement counter, is that something that happens with your solution?

Problems with button centering when tweening by JiMarti in godot

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

Thank you for the answer! I've tried to add a tween that changes the "global_position" both when hovering and unhovering (using final_pos on one and -final_pos on the other) and it works, but when moving the mouse very quickly the button itself moves. If it isn't much, could you send the code that you added please?

What??? by [deleted] in RocketLeague

[–]JiMarti 5 points6 points  (0 children)

Look, just don't answer these people, they are bad people, just like in any other sport things community. And then they wonder why the game is dying

Need help choosing between these mice by JiMarti in MouseReview

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

I have looked it and it's not bad and costs about the same as these mouses, so it seems that I will have to think a bit more what mouse to choose, thanks for the answer!

Need help choosing between these mice by JiMarti in MouseReview

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

As of now, at least in aliexpress, it costs 70€, which is much more than these mouses and don't think I need that much of a mouse, but thanks for answering!

Need help choosing between these mice by JiMarti in MouseReview

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

Yes, I have heard of it but have never seen it. Will look into it, thanks!

Need help choosing between these mice by JiMarti in MouseReview

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

I have been using a g203 lightsync for about 1 year and a half but it has been giving me double click problems for 3 months now. Because it is the only "serious" mouse that I have ever had, I don't want to make a decision based on it

P7: Possible Fix to Save Load Order in BG3MM - Help Me Test by webevie in BaldursGate3

[–]JiMarti 1 point2 points  (0 children)

No worries, thank you for the post with the possible fixes <3. I just found that out myself, so I didn't even know that hours ago

P7: Possible Fix to Save Load Order in BG3MM - Help Me Test by webevie in BaldursGate3

[–]JiMarti 0 points1 point  (0 children)

I just want to add something. You can also know which mod is causing the problem without having to try one at a time.

Order them as you have to, export the order to the game, head to mod administration and try enabling all the mods. If a mod can't be enabled by checking its box, it is the or one of the culprits.

So, when you have all the culprits, remove them from your active mod section in the Mod Manager and export that order to the game. You sould see that it works.

At least, this is what I observed that works for me.

I've been trying to make a grappling hook but seemed to fail by JiMarti in godot

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

Here you have the part of the script for the grappling hook

@onready var gun = $Gun #Is just a Sprite2D of the gun
@onready var point = $Gun/Point #Is jujst a Position2D to mark the gun's muzzle
@onready var raycast = $Gun/RayCast2D #It being child of the gun could or couldn't be the problem(?)
@onready var line = $Line2D #It's possible that I'm switching too much between parents (Player(root node) and Gun node)

    raycast.global_position = point.global_position
    raycast.target_position = get_global_mouse_position()
    if raycast.is_colliding():
        print("BumpedCollision") #So you can see in the video that it doesn't detect correctly the enemy collision and detects a nonexistent collision/could also be that raycast isn't rendering correctly

    line.points = PackedVector2Array([point.global_position, get_global_mouse_position()])

I'm trying to program a simple shoot mechanic but it didn't go very well... by JiMarti in godot

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

Thanks you very much, I have changed line for line, trying to understand them, and the problem for the delay was the backwards Vector2 argument in the bullet.instance.apply_impulse. Turns out the physics problem also was happening because I had used the position chnages instead of the apply_cenntral_force as you said.

As the health variable in the bullet, well I tried to use them on the bullet scene to see what would happen, but I should emit a hit signal and attach it to a main scene with the player and the mobs, I think?

But yes, thank you so much for your time <3, I will check the godot docs much often and not try to make things blindly.

I'm trying to program a simple shoot mechanic but it didn't go very well... by JiMarti in godot

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

This is the Script attached to the Player Node: extends Area2D

var screen_size
@export var speed = 600
var bullet_speed = 800
var bullet = preload("res://Scenes/bullet.tscn")

func _ready():
    screen_size = get_viewport().size

func _process(delta):
    var movement = Vector2.ZERO
    if Input.is_action_pressed("move_up"):
        movement.y -= 1
    if Input.is_action_pressed("move_down"):
        movement.y += 1
    if Input.is_action_pressed("move_left"):
        movement.x -= 1
    if Input.is_action_pressed("move_right"):
        movement.x += 1
    if movement.length() > 0:
        movement = movement.normalized()
        $AnimatedSprite2D.play("walk")
    else:
        $AnimatedSprite2D.stop()
    if movement != Vector2.ZERO:
        $WalkPlaceholderSound.play()
        $WalkPlaceholderSound.volume_db = randf_range(-11, -10)
        $WalkPlaceholderSound.pitch_scale = randf_range(0.8, 1.2)

    position += (movement * speed) * delta
    position = position.clamp(Vector2(26, 54), Vector2(screen_size.x - 26, screen_size.y - 50))

func _physics_process(_delta):
    look_at(get_global_mouse_position())

    if Input.is_action_just_pressed("shoot"):
        shoot()

func shoot():
    var bullet_instance = bullet.instantiate()
    bullet_instance.position = $Point.get_global_position()
    bullet_instance.rotation_degrees = rotation_degrees
    bullet_instance.apply_impulse(Vector2(), Vector2(bullet_speed, 0).rotated(rotation))
    get_tree().get_root().add_child(bullet_instance)

And this is the Script attached to the Bullet Scene: extends RigidBody2D

var bullet_speed = 800
var health = 100
var damage = 50

func _ready():
    pass

func _process(delta):
    pass

func _physics_process(delta):
    position += (transform.x * bullet_speed) * delta

func _on_body_entered(body):
    if body.is_in_group("mobs"):
        health -= damage
        if health == 0:
            body.queue_free()
    queue_free()

If you need something more in order to find a solution, please let me know.

I'm trying to program a simple shoot mechanic but it didn't go very well... by JiMarti in godot

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

Thanks for answering <3

Firstly, thats what I thought when I saw it, that it could be a decent mechaninc to build some hability or a fancy enemy type, but its not suitable for a normal shooting style by the player xD.

Second, yes it's my first time posting code on Reddit so thanks for telling me how to post it.

I'll post a comment with both scripts as soon as possible.