[SOLVED] Check Item-Dragging & query SceneObject/Character

  • #10, z caligarimarteFriday, 13. May 2016, 00:17 hodinky 9 years ago
    You were most probably right about Buttons counting as Objects, either that or for some Reason the SaveObject-Action was flawed. Anyway, I've had enough of it and decided to settle with a functional albeit unclean Workaround: The LeftClick Function now has two IF-Querys (again), one for Scene Objects (i.e. NO Buttons) and one for Characters, both including a Save Objects Actionpart, while the Script no longer has these Things. An uncleanly "doppelt gemoppelte" Tautology, but it works perfectly, and the Script still makes the other Things I needed a Script for simpler and cleaner, so while I am unhappy with having wasted Time in Vain and a Longing toward unreachable Goals, as well as -- alas -- sacrificing one Line of Code you had so helpfully given me, I still can be at Peace and work more productively on this Project again.
    Also vielen herzlichen Dank für deine Hilfe! smile

    Fanoušek fóra

    145 Posts


  • #11, z sebastianFriday, 13. May 2016, 08:33 hodinky 9 years ago
    Well what you could test out to merge it back to the lua script is testing if the object is not only inside objects and characters, but also NOT inside the buttons table...

    if ( game.CurrentObject:getId().tableId == eObjects and not game.CurrentObject:getId().tableId == eButtons )
    or game.CurrentObject:getId().tableId == eCharacters
    then...


    I think its worth a test wink

    I for myself also have the "workaround" solution for my game right now (testing scene object or item in action part). Everything is set up in action parts without lua right now. I agree that its annoying everytime i make doors or want not allow to display the verb coin.
    My coin - other than yours- opens on mousehold (like in MI3) so i never experienced the issue you had. But the reason you made the script is a good reason! Ill try it out myself some time and test if this works for me, too. Ive already implemented renaming the buttons name to change the actiontext to something new (e. G. use > press) depending on the objects internal name and some keywords in it (similar to your string.find in your lua).
    Would be easy to expand this to checking the door Name and disable the menu then...

    Kapitán

    2346 Posts