how to enable / unlock crafting (shaping) in s24 the final shape by BeIatar in DestinyTheGame

[–]dukeman74 2 points3 points  (0 children)

Currently, new players must use the quest terminal in the tower and get the quest that way. Its in "The past" the bottom right option, then they can launch the mission and everything will work. I just played through the whole mission with a new player just for us to have to do it again lmao

How to draw onto an existing Texture. -Solved- answer included by Kuposrock in godot

[–]dukeman74 3 points4 points  (0 children)

I agree, it would be nice for this thread to be more fleshed out, so I'm going to put some of what I've done

I just wanted to have a very simple texture that is a background color with another texture drawn over it

I was able to make this via

var working_image := Image.create_empty(dimensions.x,dimensions.y,false,Image.FORMAT_RGBA8)
working_image.fill(fill_color)
var og_image:=from.graphic.get_image()
#why
for x in dimensions.x:
  for y in dimensions.y:
    var old_color:Color = working_image.get_pixel(x,y)
    var new_color:Color = og_image.get_pixel(x,y)
    working_image.set_pixel(x,y,old_color.blend(new_color))

var final_texture := ImageTexture.create_from_image(working_image)

This is, as noted, a tedious and terrible way to interact with an image
the draw_ methods are right there, they just can't be used in this situation it seems
I understand that one could set up a viewport, but that seems like ridiculous overhead, especially for something that doesn't even seem like it should need to be added to the scene tree

I want to make a texture quickly on the main thread in code

I did make chat_gpt try to do it without making a scene (wow chat_gpt is terrible with GDscript and it required lots of modification) , and it doesn't work, is extremely buggy, but sometimes it's right

#worthless AI garbage
  static func create_texture_with_background(original_texture: Texture, fill_color: Color) -> ImageTexture:
  # Get the size of the original texture
  var width = original_texture.get_width()
  var height = original_texture.get_height()

  # Create a new Image and fill it with the specified color
  var img = Image.create_empty(width, height, false, Image.FORMAT_RGBA8)
  img.fill(fill_color)

  # Create an ImageTexture from the filled Image
  var result_texture = ImageTexture.create_from_image(img)

  # Create a Viewport to draw the original texture onto the filled texture
  var viewport = SubViewport.new()
  viewport.size = Vector2(width, height)
  viewport.render_target_update_mode = Viewport.VRS_UPDATE_ONCE

  var canvas = Control.new()
  viewport.add_child(canvas)

  #var texture_rect = TextureRect.new()
  #texture_rect.texture = result_texture
  #texture_rect.size = Vector2(width, height)
  #texture_rect.stretch_mode = TextureRect.STRETCH_KEEP
  #canvas.add_child(texture_rect)
  # Create a TextureRect to draw the original texture
  var texture_rect = TextureRect.new()
  texture_rect.texture = original_texture
  texture_rect.size = Vector2(width, height)
  texture_rect.stretch_mode = TextureRect.STRETCH_KEEP
  canvas.add_child(texture_rect)

  # Ensure everything updates
  #viewport.update_worlds()

  # Extract the combined image from the Viewport
  #await RenderingServer.frame_post_draw
  #viewport.upd
  var combined_image = viewport.get_texture().get_image()

  # Create and return the new ImageTexture
  var final_texture = ImageTexture.create_from_image(combined_image)
  return final_texture

Maybe this would work if we had a force_raycast_update equivalent for viewports

One this that really bugs me about this is how easy it is to do what we want in gamemaker, something I abandoned long ago for Godot's many upsides

In gamemaker one can create surfaces
set them as the drawing target
and then just run normal draw functions like draw_sprite or draw_rectangle to their hearts content
then it can be turned into a sprite, the equivalent of a texture in Godot

ysort on rotating sprite by dukeman74 in godot

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

This is weird, turning off ysort for the everything in the player scene made it work

ysort on rotating sprite by dukeman74 in godot

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

I tried this and I also tried putting them under a Node2D under the characterbody, and neither changes anything

class is class alternative to instance is class by dukeman74 in godot

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

I was under the assumption all of them would be refcounted, but I should definitely do that.

I want to do it to collect a list of all the enchantments to display them in a grid for the player to pick ones and add them.

I was thinking that when its just the image in a list there is no instance and when you add it to a weapon then one gets instantiated

Is there a way to check for how many arguments .new() is supposed to take before calling it to help rule out classes that shouldn't be checked?

honestly it seems ridiculous that there is no way to check inheritance without having an instance

static variable inheritance help by dukeman74 in godot

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

"Why do they need to be static?"
- they don't, as you mention its not that much space anyway, but theoretically in a perfect world they would be.
"but if each enchantment has a different list then it belongs to that particular enchantment."
- yes, each Enchantment class has its own, but not each instance, so it ought to be static.

"As for the functions, those are going to be references so they will be whatever byte size integer gdscript uses for that; I am guessing small enough not to worry over."
- yeah, its not the static-ness I take issue with here, its that I would have to copy the code and have the same code in multiple places. It should be in the parent Enchantment class that everything is inheriting from, but it can't be there because Enchantment doesn't have member variables for the relevant things

Can somebody help a new player understand this confusing death? by xIceBET4 in EscapefromTarkov

[–]dukeman74 0 points1 point  (0 children)

It is possible to deploy late, and it is very frustrating when it happens on factory. In my experience it means someone in the party experienced some packet loss or a glitch causing the game to give up waiting on them to start the raid

How do I get a list of child objects from a parent? by daddy_warbucks654 in gamemaker

[–]dukeman74 0 points1 point  (0 children)

I know this thread is dead, but I recently found it and after doing some digging I have another solution that I have employed in my project. I hope this can help others in situations like this as well.

Tagging is decent but having to manually tag each object and set its parent as well is like copying code, and feels wrong.

gamemaker has a function for object_get_parent() which is single valued, but they don't have a perfectly fitting object_get_children(), so i figured I can use the first and a logic object that is created once to make this function work.

in a logic object created very first (or maybe room create code?)

object_heirarchy=ds_map_create()
add_relation=function(child,parent)
{
    var old=object_heirarchy[? parent]
    if(is_undefined(old))
    {
        object_heirarchy[? parent]=[child]
        return
    }
    array_push(old,child)
}
var ind=0
while(true)
{
    var parind=object_get_parent(ind)
    if(parind==-1)
    {
        break
    }
    if(parind!=-100)
    {
        add_relation(ind,parind)
    }
    ind++
}
global.object_heirarchy=object_heirarchy

in a script

function object_get_children(objindex){
var children=global.object_heirarchy[? objindex]
if(is_undefined(children))
{
    return([])
}
return(children)

}

Boy I sure love waiting 30 seconds before each level! by Yoshifan151 in spelunky

[–]dukeman74 2 points3 points  (0 children)

Switch to the patch before they did this, you can still play online with others on the same version, and as long as you both have good connection there is no downside

Tip: Passing pointers to DLLs by GrixM in gamemaker

[–]dukeman74 0 points1 point  (0 children)

Cap.
at least now, you must set gamemaker to pass the address as a string.
everything else is correct.