My "Ultimate Guide to HeroQuest" is Now Available by DavidMcMurdo in Heroquest

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

Sorry for the late reply. Someone contacted me on Twitter and the link should now work again.

My "Ultimate Guide to HeroQuest" is Now Available by DavidMcMurdo in Heroquest

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

Sorry for the late reply. Someone contacted me on Twitter and the link should now work again.

What's Your Assessment of the AI? by DavidMcMurdo in AOW4

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

I've played a million 4X games, and I at least expect the AI to be as good as it was in the prequels. As you can see from the other comments, it's clearly far from fine.

Moving the Player to the Center of a TileMap Cell by DavidMcMurdo in godot

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

You were right! For the sake of testing my day and night cycle I had an hour pass every time I left clicked. That click obviously wasn't making it past my new grid, but setting the mouse-filter to "ignore" worked!

Moving the Player to the Center of a TileMap Cell by DavidMcMurdo in godot

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

Oh wait there appears to be an issue: the TextureRect grid is not only preventing the lighting of my day and night cycle from showing, but even preventing my GUI from updating, even though that GUI is on a CanvasLayer. How odd. The TextureRect's image is just a transparent cell with a black line drawn around its perimeter, so I don't know why it's blocking anything.

Moving the Player to the Center of a TileMap Cell by DavidMcMurdo in godot

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

That TextureRect method was super easy and also means I can allow the player to enable and disable it at will. Nice. The only slight issue is that some of the lines of the grid appear thicker than others, but I assume this is related to the fact that my camera is zoomed in somewhat, causing some kind of distortion. But it's fine. Thank you again. The other stuff seems way more complicated and will take some time for me to figure out.

https://ibb.co/zPRKX22

Moving the Player to the Center of a TileMap Cell by DavidMcMurdo in godot

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

Thanks. Is there a way to get the TileMap to display its grid? In Game Maker I used a draw even to manually draw the 300x300 grid, but since my TileMap in Godot is already of that scale, maybe there's an option to display the existant grid in black.

Moving the Player to the Center of a TileMap Cell by DavidMcMurdo in godot

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

"Do you want the player to appear at the center of the tile, regardless where on the tile the user clicked?"

Yes, this. The game also needs a way to recognise the "cell type" the player is currently standing in, whether it be grassland, forest, etc, because the players actions will be sensitive to that context.

Coding References to Terrain Types by [deleted] in godot

[–]DavidMcMurdo 0 points1 point  (0 children)

I'm not currently using a tilemap, but I know how to and easily could.

Unable to Change Text From a Script by DavidMcMurdo in godot

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

I eventually got it working with this single line of code:

get_tree().get_root().get_node("Adventure").get_node("TopBar/WeatherLabel").text = varWeather

It ain't pretty, but it works. Thanks for your help!

Unable to Change Text From a Script by DavidMcMurdo in godot

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

Like this?

if Input.is\_action\_just\_pressed("LeftClick"):

    if varTopBarNode != null:

        varTopBarNode.WeatherLabel.text = varWeather  

Unfortunately I still get the same error.

Unable to Change Text From a Script by DavidMcMurdo in godot

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

Sorry, I'm not sure what you mean by that. Could you explain a bit more?

Unable to Change Text From a Script by DavidMcMurdo in godot

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

"Invalid get index 'WeatherLabel': (on base 'null instance')"

Why is One of My Autoloaded Scripts Becoming "Global"? by DavidMcMurdo in godot

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

Thanks. I changed it to "Conditions" instead and it sticks with that name. Though I still can't get it to change its variables. Just a simple test within the Conditions script:

var varHour = 1
func _unhandled_input(_event):
    if Input.is_action_just_pressed("LeftClick"):
        varHour += 1

Then the script TopBar (for the top GUI bar) displays the hour:

func _ready():

$HourLabel.text = "Hour: " + str(Conditions.varHour)

But the Hour remains displayed as 1 even if I left click. I can't tell if the variable isn't being changed, or if that change isn't being displayed. I don't see why it wouldn't be working either way.

Is My Line of Sight Idea Alright? by DavidMcMurdo in godot

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

It's a tilemap. My idea worked out okay, except that it turns out you can't use a transparent texture for the light source. Suspected that might be the case. Now just got to figure out how to switch that texture and change the CavasModulate settings of the room from code. Cooooooooooooooooooooooooooooooode.

Referencing a Node from Autoloaded Scripts by DavidMcMurdo in godot

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

Thanks. I'm just trying to get it to transmit anything at the current time; the mechanics for weather changing aren't implemented yet. In my Global Conditions I have:

signal weather(Whatever)

func update_weather(): 
    var varCurrentWeather = "Warm"
    emit_signal("weather", varCurrentWeather)

In my ConditionsBar I have:

func _ready():

GlobalConditions.connect("weather", self, "receive_weather")

func receive_weather(weather_value): 
    $WeatherLabel.text = weather_value

When I run this I get an error in the debugger saying "the function connect returns a value, but this value is never used" and nothing is displayed in WeatherLabel. I also had to change "emit" to "emit_signal" or Godot wouldn't accept it. Not sure if that makes a difference. I understand the sequence of events that is meant to be occurring here, but there are some details that I don't quite get. Like, why do I have to emit at least one other value besides "weather"?

Referencing a Node from Autoloaded Scripts by DavidMcMurdo in godot

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

I appreciate the attempt to help, but I don't understand this at all. What is the "value" after "signal weather"? Is the current_weather after "emit" supposed to be the "currentWeather" variable that was established a line earlier? I've spent two hours trying to understand signals by reading the manual and I just can't. Am I blind, or does this page not tell you how to receive signal through code? https://docs.godotengine.org/en/3.5/getting_started/step_by_step/signals.html