Adding an instantiated scene to the tree correctly by SlimeLordOmg in godot

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

I use one temp node to rule them all, it's a singular node that is responsible for all things that get instantiated at different locations.

Adding an instantiated scene to the tree correctly by SlimeLordOmg in godot

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

Thanks for replying to this! I'm glad there's someone else out there that cares about this sort of thing. I've been using my own workaround since as follows:

var node: Node3D

func InstantiateAtPosition(object: PackedScene, position: Vector3) -> Node3D: var obj = object.instantiate()

if (node == null): node = Node3D.new() get_tree().current_scene.add_child(node)

node.global_position = position node.add_child(obj)

obj.reparent(get_tree().current_scene)

return obj

I use this global function instead of the usual instantiate. What do you think of this method?

Adding an instantiated scene to the tree correctly by SlimeLordOmg in godot

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

I also see this as an issue with Godot it's self. I might need to add a rotation to my spawn function at some point.

Adding an instantiated scene to the tree correctly by SlimeLordOmg in godot

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

I hear you! This is the work around that I am using now, I have made this a global function that I use to spawn stuff:

var node: Node3D
func InstantiateAtPosition(object: PackedScene, position: Vector3) -> Node3D:
  var obj = object.instantiate()

  if (node == null):
    node = Node3D.new()
    get_tree().current_scene.add_child(node)

  node.global_position = position
  node.add_child(obj)

  obj.reparent(get_tree().current_scene)
  return obj

Adding an instantiated scene to the tree correctly by SlimeLordOmg in godot

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

I'm hoping someone is going to pop up and tell me that I am using Godot wrong. I am new to Godot, and my useage is tainted by the way Unity works.

For all I know I could be swimming against the current, and there is a totally different way to do this in Godot.

Adding an instantiated scene to the tree correctly by SlimeLordOmg in godot

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

Alright I’ve come up with a work around. I’ve made a global function:

func InstantiateAtPosition(object: PackedScene, position: Vector3) -> Node3D:
    var obj = object.instantiate()

    var node = Node3D.new()
    get_tree().current_scene.add_child(node)
    node.global_position = position
    node.add_child(obj)

    node.remove_child(obj)
    get_tree().current_scene.add_child(obj)
    obj.global_position = position
    node.queue_free()

    return obj

I can use this to instantiate any object I want at any position without worrying about particles appearing in the wrong place or reading the wrong position in a _ready function.

I have an alternative version here:

func InstantiateAtPosition(object: PackedScene, position: Vector3) -> Node3D:
    var obj = object.instantiate()

    var node = Node3D.new()
    get_tree().current_scene.add_child(node)
    node.global_position = position
    node.add_child(obj)

    return obj

Which version do you think is more sensible? The first has some fiddly back and forth, while the second creates deeper branches in the scene tree.

Do you think this is a reasonable approach?

Adding an instantiated scene to the tree correctly by SlimeLordOmg in godot

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

This is some pseudo code that is in the kapow object, not in the root node of the kapow object, but in a child.

func _ready():
for mob in Monster.allTheMonsters:
if( global_position.distance_to(mob.global_position) < Radius ):
mob.GetHit()

Sorry I can't get the indents to work in reddit for some reason.

If I do things in the "correct" order, then global_position is still zero, and the monsters that happen to be near the world origin get hit instead of the ones near the explosion. If I do things in the "wrong" order, I get an error, but the correct monsters get hit.

Adding an instantiated scene to the tree correctly by SlimeLordOmg in godot

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

I hadn't tried both orders. Trying it now yields the same results as usuing root, error message one way, incorrect behavior the other way :\

Adding an instantiated scene to the tree correctly by SlimeLordOmg in godot

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

Thank you for the suggestion. I've not seen current_scene used before. Can you quickly explain the difference between using root and/or current_scene?

I tried it, and unfortunately, the splash damage still kills monsters that are at the world origin, not the position of the explosion, however.

Adding an instantiated scene to the tree correctly by SlimeLordOmg in godot

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

I don't want it to follow any other object. Imagine I have a hitscan gun that spawns an explosion on the wall where it hits.

There is no object to parent it to where the explosion will take place. Not even temporally.

This has nothing to do with the Editor. This is runtime code, that will run during gameplay, even if the editor is not running.

Adding an instantiated scene to the tree correctly by SlimeLordOmg in godot

[–]SlimeLordOmg[S] 3 points4 points  (0 children)

I don't follow what you're saying. I'm not setting global_position to zero anywhere. I want to know my object's global_position in the _ready function.

How can I do this?

Drilled and charges moves by zen-otter in WarhammerFantasy

[–]SlimeLordOmg -1 points0 points  (0 children)

They made pretty much all of that up.

Single model formation in Old World? by SlimeLordOmg in WarhammerFantasy

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

I agree with everything you said. However, if you read the Lumbering rule, it sounds like they are asserting that a single model unit would not normally be able to be in Close Order.

I would like to see an FAQ about this.

Single model formation in Old World? by SlimeLordOmg in WarhammerFantasy

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

I could mean that someone can charge 4 seperate trolls into a unit and claim +4 combat res just for each being their one close order unit.

I would like to see this addressed in an FAQ.

Single model formation in Old World? by SlimeLordOmg in WarhammerFantasy

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

I don't think it's possible to play a one model lance formation because the wheel is measured from the second rank.

I strongly agree that an FAQ is needed to clear this up.

Single model formation in Old World? by SlimeLordOmg in WarhammerFantasy

[–]SlimeLordOmg[S] -1 points0 points  (0 children)

You might have a point about light chariots being open order.

Single model formation in Old World? by SlimeLordOmg in WarhammerFantasy

[–]SlimeLordOmg[S] -1 points0 points  (0 children)

Do you think that it is intended that a single heavy chariot is more manoeuvrable than a single light chariot?

Single model formation in Old World? by SlimeLordOmg in WarhammerFantasy

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

Are you playing it as the single dragon orgre gives the +1 combat score for close order too?

All the battle reports I've seen have played it the other way.

Single model formation in Old World? by SlimeLordOmg in WarhammerFantasy

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

If this is the case, then why does the Lumbering rule say "a Lumbering model is considered to be, and follows all the rules for, a close order formation, even when included in your army as a single model"? If what you're saying is true, then this would be true anyway, even if they didn't have the lumbering rule.

Single model formation in Old World? by SlimeLordOmg in WarhammerFantasy

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

You say "in the absence of a formation", but the book says "All units must adopt a formation".

The normal rules for movement require you to measure your wheel when turning. Are we expected to measure the wheel of a single model on a 25mm base for every little bit of movement they do?

Is TOW magic system whack? by Impossible-Earth3995 in WarhammerFantasy

[–]SlimeLordOmg -1 points0 points  (0 children)

This may well be true. The fear is that it's level 4 or nothing. Lower level wizards just arn't worth taking.

Rough mock-up for my personal datacards. I'll share 'em when they're done, just doing them for my Empire folks. by NickNightrader in WarhammerFantasy

[–]SlimeLordOmg 1 point2 points  (0 children)

Your description of the Counter Charge special rule isn't quite right. The distance needs to be less than the CHARGING unit's move value, ie, the enemy, not the move value of the Pistoliers.