Fizz

joined 3 years ago
MODERATOR OF
[–] Fizz@lemmy.nz 12 points 5 hours ago* (last edited 5 hours ago) (5 children)

yeah this one is going to require a bit more explaination you cannot just post that link. Is this for multi user systems or what?

[–] Fizz@lemmy.nz 13 points 6 hours ago* (last edited 6 hours ago)

Obviously depends on the women and what they're looking for/enjoy. But from my experience women are generally fine with this and even want to engage in a lot of this. But I really dont think its what most men want (personally I hate most of the things on your list and actively communicate it) so unless you communicate it to your partner that you do prefer these things they probably wont be like this towards you.

Just keep in mind that you will encounter people who dont like this and thats fine, consider it a filter and move on.

[–] Fizz@lemmy.nz 1 points 21 hours ago

My brain is cooked. I thought that first lightbulb pick was some homemade flashlight device before a lightbulb

[–] Fizz@lemmy.nz 2 points 23 hours ago

Delete your own databases, the AI method of software development?

[–] Fizz@lemmy.nz 1 points 23 hours ago

I'd hire slop writers to make articles saying X open source project got hacked y open. Source project got hacked. Then spam replies on the threads when they get posted to reddit with replies like "this is bad, I'm going bad to BigEvilCorp because they have a fulltime team working security". Itd manufacturer reality for people and eventually it'd shift perception.

Also the articles about projects being hacked dont even have to be real. Misinfo travels way faster than the truth

[–] Fizz@lemmy.nz 1 points 1 day ago

Its funny because you can use any number and people are shocked because how how its framed. When i compared the numbers vs other industry I was like oh its a nothing burger and Americans are being brainwashed again.

[–] Fizz@lemmy.nz 8 points 1 day ago

I smoked my last celebratory cigar when Charlie died. I'll need to get something more for trump

[–] Fizz@lemmy.nz 1 points 1 day ago
[–] Fizz@lemmy.nz 1 points 1 day ago (1 children)

Its open source its not locked behind anything.

[–] Fizz@lemmy.nz 2 points 2 days ago (1 children)

What's the issue? Shes qualified and a domain expert. The company is wanting to do a merger and needs to navigate the merger. Hiring someone like this to help you navigate government affairs isnt corrupt. In no world would this not happen. Im sure shell do a great job at making the case and trying to compromise and build a consensus but that isnt corruption.

[–] Fizz@lemmy.nz 2 points 2 days ago

Shadowy profiteers driving up prices during times of extreme scarcity. Im shocked and appalled. Those dam shadowy profiteers

 

I'm really not sure how to feel about this one. On one hand its great that less dogs are being put down. On the other hand people who got their dog impounded and couldnt afford $93 are taking an after pay loan to get it back. As someone who used to live in south auckland I feel like this is going to make the roaming dog problem way worse. If you're getting your dog impounded and after paying $93 then you are probably not equipped to be owning a dog.

 

I want to preface this by saying that I think I got cooked by AI here.

I have a game where I am working on a job system. The job system has a job objects which I need to put into a data structure that can be searched via id, location, or work type. At first I was building with the mindset of "do whatever to solve this problem and make it work" but it became very hard to implement new features because I would break everything. So I started trying to think ahead and design ways of doing things that would handle all the different jobs and things.

At first I put all jobs into an array and iterated through. Then I learned about dictionaries and started using them for way to many things and so i updated my job queue to be a dictionary with the Key as ID > JobObj

Then I decided to plan out the job system before writing anything and "do it properly". I decided I needed to upgrade the data structure holding jobs because its a core part of the game and will be heavily interacted with. But I realized I only know array, dictionary and database, so I asked AI what data structure I should use and it suggested a nested dictionary.

Now im using multiple dictionaries but im really hating it. Its hard for me to work with and conceptually im not sure I can visualize how its even working.

How I am thinking about it is there is multiple layers of keys, 1st layer is work types, then once I find the work type it points to a dictionary of region IDs and that points to an array of jobs in the region.

Job def is work type like Planting Region id: the map is broken down into region IDs so i dont have to check every tile and can limit seaching

#python
var job_pool: Dictionary = {}

func register(designation: DesignationObj) -> void:
	var job_def = designation.job
	var region_id = designation.region_id
	if not job_pool.has(job_def):
		job_pool[job_def] = {} 
	if not job_pool[job_def].has(region_id):
		job_pool[job_def][region_id] = []
	job_pool[job_def][region_id].append(designation)

Here is how I am picturing it in my head.

var job_pool {
	"plants": {
		"1": {
			"job1"
			"job2"
		}
		"2": {
			"job3"
		}
	}
	"mining": {
		"1": {
			"job4"
			"job5"
		}
	}
	"hunting": {
		"5":{
			"job12"
		}
	}
}

But now I want to add ID look up into this im stuck and im thinking the entire structure does not work for what it needs to do.

 

Photo taken by Dorothee Ehrich

 

I am working on the input and it feels like its getting out of hand. I wanted to check in with people and see how people structure their input handling.

Currently I have 1 function _unhandled_unput(event) and inside there I have a ton of elif statements trying to handle every possible situation and event. Its manageable at the moment but I only have like 4 events so its going to get very out of hand if I continue.

I need to have 100s of these events based on whats selected and what mouse/keyboard buttons are being pressed and I need some way to resuse the actions.

spoiler

func _unhandled_input(event):
	if event is InputEventMouseButton and event.pressed:
		if event.button_index == MOUSE_BUTTON_RIGHT:
			clear_selection()
			gui.queue_redraw()
			get_viewport().set_input_as_handled()
			return
	if selected_item == "colonist": #broken
		if event is InputEventKey:
			if event.OS.get_keycode_string() == "r":
				for colonist in selected_group:
					colonist.set_state("DRAFT")
					get_viewport().set_input_as_handled()
					gui.queue_redraw()
	#nothing selected dragbox to select things and single click to select things - does not work at the moment
	elif selected_type == "" or selected_type == "basic":
		if is_dragging and event is InputEventMouseMotion:
				drag_end = camera.get_global_mouse_position()
				cam_drag_end= get_viewport().get_mouse_position()
				get_selection(drag_start, drag_end)
				gui.queue_redraw()
				get_viewport().set_input_as_handled()
				return
		elif event is InputEventMouseButton and not event.pressed:
			is_dragging = false
			gui.queue_redraw()
			drag_start = null
			drag_end = null
			get_viewport().set_input_as_handled()
			return
		elif event is InputEventMouseButton and event.pressed:
			if event.button_index == MOUSE_BUTTON_LEFT:
				selected_type = "basic"
				is_dragging = true
				drag_start = camera.get_global_mouse_position()
				cam_drag_start = get_viewport().get_mouse_position()
				gui.queue_redraw()
				get_viewport().set_input_as_handled()
				return
	#command flow for dragging a selection box
	elif selected_type == "command":
		if selected_item == "structure_dict_growing":
			if is_dragging and event is InputEventMouseMotion:
				var grid_pos = tilemap.local_to_map(camera.get_global_mouse_position())
				var local_pos = tilemap.map_to_local(grid_pos)
				drag_end = local_pos + Vector2(32, 32)
				cam_drag_end = get_viewport().get_mouse_position()
				gui.queue_redraw()
				get_viewport().set_input_as_handled()
				return
			elif event is InputEventMouseButton and not event.pressed:
				if event.button_index == MOUSE_BUTTON_LEFT:
					is_dragging = false
					gui.queue_redraw()
					get_viewport().set_input_as_handled()
					MessageBus.rpc_id(1, "request_zone_growing", selected_item ,drag_start, drag_end, multiplayer.get_unique_id())
					drag_start = null
					drag_end = null
					return
			elif event is InputEventMouseButton and event.pressed:
				if event.button_index == MOUSE_BUTTON_LEFT:
					is_dragging = true
					#to snap to grid
					var grid_pos = tilemap.local_to_map(camera.get_global_mouse_position())
					var local_pos = tilemap.map_to_local(grid_pos)
					drag_start = local_pos - Vector2(32, 32)
					cam_drag_start = get_viewport().get_mouse_position() #this is broken cbf fixing maybe one day after selection is working 
					gui.queue_redraw()
					get_viewport().set_input_as_handled()
					return
	elif selected_type == "floor":
		if event is InputEventMouseButton and event.pressed:
			if event.button_index == MOUSE_BUTTON_LEFT:
				var global_mouse_pos = camera.get_global_mouse_position()
				var grid_pos = tilemap.local_to_map(global_mouse_pos)
				if selected_item == "":
					return
				MessageBus.rpc_id(1, "request_build_floor", selected_item, grid_pos, multiplayer.get_unique_id())
				get_viewport().set_input_as_handled()
				return
	elif selected_type == "building":
		if event is InputEventMouseButton and event.pressed:
			if event.button_index == MOUSE_BUTTON_LEFT:
				var global_mouse_pos = camera.get_global_mouse_position()
				var grid_pos = tilemap.local_to_map(global_mouse_pos)
				if selected_item == "":
					return
				MessageBus.rpc_id(1, "request_build_structure", selected_item, grid_pos, multiplayer.get_unique_id())
				get_viewport().set_input_as_handled()
				return

 

Edit: ah i was reading an old doc because the reddit comment I saw was 6 years old. The property is get_property_list()

I have a script that is a global it contains a bunch of dictionaries that describe items. I need a way to get a list of the different types.

Searching for solutions I found https://docs.godotengine.org/en/3.2/classes/class_script.html#class-script-method-get-script-property-list

but I cant seem to get it working. Godot says "Function "get_script_property_list()" not found in base self"

Example of the what im trying to get a list of

var tile_dict_grass = {
	"name": "grass",
	"source": 1,
	"atlas": Vector2i(1,0),
	"move_speed": 0.80,
	"path_cost": 2,
	"fertility": 1,
	"cleanliness": 1.5,
	"flammability": 0.60,
	"build_categories": "all",
	"solid": false
}
var tile_dict_rich_soil = {
	"name": "rich soil",
	"source": 1,
	"atlas": Vector2i(1,0),
	"move_speed": 0.80,
	"path_cost": 2,
	"fertility": 1.4,
	"cleanliness": -1.0,
	"flammability": 0.0,
	"build_categories": "all",
	"solid": false
}

How im trying to get it.

func get_tile_dict():
	var property_list = self.get_script_property_list()
	var tile_list = []
	for attr in dir(self):
		if attr.startswith('tile_dict'):
			value = getattr(self, attr)
			tile_list.append(value)
	return tile_list
 

I have a characterbody2d and I want to display the equipment being worn. So this equipment would need to be swapped around during game play.

I currently am using several sprites layered. How is best to handle this situation?

 

I've tried a few peertube instances, peertubenz tilvids, makertube and a few others. I always run into a problem that I dont experience on mastodon or lemmy. I will follow a link and I will try and subscribe to that person from my peertube account and I wont be able to because whatever peertube instance im on doesnt federate.

I get not wanting to federate with every random server but I would have expected a decent network to have formed.

Maybe I have just been signing up to the wrong instances or am doing something wrong.

view more: next ›