Welcome Forums Requests Let us access actors from the hero’s “when hurt”-event

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #79089
    Marby
    Moderator

    …as the title states, we unfortunately have no access to actors with the hero’s “when hurt”-event.
    It would be great to have a ticket for this at Trello.

    #79165
    Macmor
    Moderator

    Do you mean npc’s don’t have that option? If so, choose a generic colored knight guy (the gold, blue, red ones) and change it’s appearance to the npc you want.

    If you mean you can’t make an npc do things with the hero’s ‘when hurt’ it lets me do it.

     

    #79213
    Marby
    Moderator

    I appreciate that you would like to help and try to find a workaround. However, I think an improvement of the hero’s access capabilities makes sense:
    I mean that we cannot access the properties of a npc using the hero’s “when hurt”-event.

    Imagine e. g. a vampire boss:
    We can set a token as soon as the hero enters the vampir’s domain. With this we’re able to activate screenplay programmed at the hero’s when hurt event. However, when the vampire is hurting the hero and is “drinking” his/her blood, we cannot access the vampires “health value”-property from the hero’s “When hurt”-event in order to refill the vampire’s HP.

    I know you can just activate a token (e. g. “VampireAttackPerformed”) using the hero’s “When hurt”-event, place invisible switches at that level everywhere and put screenplay in each “When touch”-event of the switches which is checking the “VampireAttackPerformed” token, reacting accordingly and deactivating it afterwards. As a programmer I of course know stuff like this. So, yes… we can have workarounds for almost everything. But I refuse to implement things this way. It is redundant, hard to maintain and just… ugly. We should have full access to every actor on every level from anywhere. Only then we can avoid implementations we will regret later.

    Why not start to make the hero’s when hurt event better? The actors’ “when hurt”-event can access every other actor’s as well as the hero’s properties. But from the hero’s “when hurt”-event we can access almost nothing. The reason for this most probably is that the hero does not belong to a certain level. Therefore, screenplay accessing the properties of actors which belong to another level will produce errors. Best would be if we have some kind of selector for our actors like:
    Vampire of level VampiresDomain health value increases with 10
    This would make clear which actor is meant. Therefore, this should also be possible from the hero’s “when hurt”-event.

    #79216
    deWiTTERS
    Keymaster

    This is a thing I forgot indeed :(. Right now you only have access to the actors of the current level, but since the hero is jumping through the levels, there might indeed be a problem that you cannot access the actors of different levels.

    It was indeed the intention that in the on-hurt, you can access everything like in other scripts (an oversight on my part).

    Added as a critical bug at: https://trello.com/c/cOinI43A

    #79230
    Marby
    Moderator

    Thanks a lot for adding! Please also consider to add the source of an attack to the hero’s (and also every other actor’s) “when hurt”-event. Then we could have something like:
    if hurt by Vampire of level VampiresDomain then …

    With this we even could have different vampires and other enemys in our game and react to their attacks differently.

    This also could be improved further if we think of direct access to the attacker actor as an object:
    if AttackerActor.Name.StartsWith(“Vampire”) then
    AttackerActor.HealthValue increases with 10
    That way we could completely avoid code redundancies and are able to use mere those two lines for every vampire of every level in our game. However, this is not the way screenplay is implemented yet so you’ve to think about how something like this could be done best.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Requests’ is closed to new topics and replies.