My features wishes

  • #30, by MachtnixTuesday, 05. August 2014, 00:18 10 years ago
    What about condition deactivation for testing? Perhaps to change program lines into comments? It's a long way to type a new condition, test it and delete it to write a new one to test and then rewrite the old one if the 2nd doesn't work. The editor isn't very comfortable to do this; I can't copy and paste a complete if-condition as a box.

    Machtnix

    Thread Captain

    1097 Posts


  • #31, by afrlmeTuesday, 05. August 2014, 00:59 10 years ago
    hmm? could you be a bit more specific please?

    I created some new workflow functions earlier the day. They are lua script but only require 1 tiny line of lua inside of an execute a script action part or via the console with exec written before the function.

    setCondition(), setVal() & toggleCondition().

    Hopefully some of these will be of some use to you.

    Imperator

    7278 Posts

  • #32, by MachtnixTuesday, 05. August 2014, 02:14 10 years ago
    Hi AFRLme,

    I don't use any LUA, I only use the editor.

    I build a condition with - maybe 10 lines - , and test it.

    If it works immediately - good.

    If not, I have to delete all 10 lines and write a 2nd one. If the 2nd doesn't work I have to delete it, remember the 1st, write it again (and change a little, of course). Or write a 3rd one.

    I think, to make two of three (or more, if necessary) conditions inactive as a comment and test only the 3rd active one will be the best way, well?

    Machtnix

    Thread Captain

    1097 Posts

  • #33, by afrlmeTuesday, 05. August 2014, 02:36 10 years ago
    not the way the data structure of the editor works, but I think I get the gist of what you are saying. In that theory we would be allowed to disable any action part, but you can't.

    I really do recommend lua script for if queries... it's just so much easier & faster, & worth the effort to learn the basics of scripting. For me if queries in the editor start to look all confusing after you've added about 3+ if queries in the same block.

    You could create your if queries inside called by other actions & then have them return a single condition true or false. For testing I mean so you don't have to keep deleting the blocks, you can duplicate it as many times as you like - still recommend lua script though.

    Imperator

    7278 Posts

  • #34, by MachtnixTuesday, 05. August 2014, 02:55 10 years ago
    *lol* I'm really goofy, that's a simple and professional solution :-) And it looks like a real program to outsource all this stuff. Thanks. I will make all inactive actions false, put them into a special place with billions of untested actions and that's it! When I want to activate I set them "true".

    I understand that the editor don't allow any /-- or !-- or §$& to include a comment.... :-)

    Machtnix

    Thread Captain

    1097 Posts

  • #35, by afrlmeTuesday, 05. August 2014, 03:25 10 years ago
    Hmm I'm not sure if you are being serious or sarcastic! razz

    Imperator

    7278 Posts

  • #36, by MachtnixThursday, 07. August 2014, 03:08 10 years ago
    Hmm I'm not sure if you are being serious or sarcastic! razz

    Only the "billions of actions" was sarcasm. But my answer was really serious! To outsource actions is a good idea.

    I'm not a "native" programmer, so I have to test a lot without understanding how it works. Things which are easy for you as a programmer I test with simple logical ideas. Sometimes I repeat a lot of conditions often and often, maybe I could do it smaller and simpler, but I don't know how.

    I need five conditions? So I make five (well, this if-clauses are often very complicated..., but what should I do? The target is: it must work at the end, that's important. How it works exactly? Not my problem...I'm the artist and the storyteller). Suddenly I need seven conditions... So I make seven...

    I really missed the feature to copy and paste a whole condition-block with several lines (perhaps to paste it here to show ;-)

    Machtnix

    Thread Captain

    1097 Posts

  • #37, by MachtnixThursday, 07. August 2014, 04:05 10 years ago
    Hi, AFRLme,

    Explanation: Simple example

    Before my character use an item 123 I have to test his/its outfit. I created several outfits with several random animations and several action animations. If the character wears a blue overall I have to start an animation which contains a character in a blue overall, right?

    2nd: some animations depend on an earlier dialog. That's real point-and-click, isn't it? I have to check if dialog xy happened and if it's true or not. What the character answered. AND if the person's cloth is blue or not. And ONE dialog is really simple, mostly I have to check three or five!

    3nd: Is item 123 in his bag soon or not? Is it a necessary item to continue the game?

    Now I have a tree of 1 *2*3*4... possibilities (s.th statistic like that)

    Sometimes I have to check 10 conditions before the action starts and I get 20 cases back what to do next. Often 50 code lines. Remember: at every item!

    My idea: I use every check in every item. That's long, but safe (yes, it is!).

    Your idea could be: I create a "function" with all important questions and call it up. I get back variables (or values) to work with. That's the "professional" way - outsourcing. One action call, that's it. With LUA: no problem. But the editor isn't that comfortable... So I built constructions with 20 if-clauses(OMG!). Now I test the solution to use ONE BIG action for all similar situations and get back 20 values. I hope it works...

    And that's why I wished to edit the editor lines in a comfortable way... ;-)

    The problem is: it's to late for THIS game to learn and use LUA. All conditions work well. It's bullshit to repair, better to make a new one... I'm waiting for a stable 4.0 now

    Machtnix

    Thread Captain

    1097 Posts

  • #38, by afrlmeThursday, 07. August 2014, 13:02 10 years ago
    I hate hate hate the if query structure in the editor. The tree layout it uses starts to get really confusing after you have added 3+ if queries into the same if query block & gets even more confusing when you try & add else action parts between them.

    This is one of the reasons why I use lua script & also one reason out of many as to why I decided to learn it. Besides the reason I just gave, it is actually often easier & faster to type out a little bit of code than it is to navigate & click around the editor action parts.

    What you are talking about can be done in lua easy enough... Let's say you have named the animations in each character outfit exactly the same, then all you need to do to trigger the correct animation based on current outfit of the active character is:
    startAnimation("Game.GameCurrentCharacter.CharacterCurrentOutfit.OutfitCharacterAnimations[animation_name]") -- replace "animation_name" with name of animation you want to play
    


    As for checking if item exists you need to store all items currently in characters inventory into a table & then iterate through them to see if the item exists... So in other words it's entirely possible to have a function check through various things & if it is then have it start an action or set a condition or value.

    There's loads & loads of lua script related stuff on the wiki, because it's what I focus on the most. I will probably get around to continuing & improving upon the "learn the basics of lua" page at some point too, which is a good place to start.

    Imperator

    7278 Posts

  • #39, by AlexThursday, 07. August 2014, 13:31 10 years ago
    I hate hate hate the if query structure in the editor. The tree layout it uses starts to get really confusing after you have added 3+ if queries into the same if query block & gets even more confusing when you try & add else action parts between them.

    what exactly is your problem with the query structure? in earlier versions (years ago) we didn't have the nested if blocks which was a mess. After a few ifs you don't see anymore which block belongs to which query.

    Maybe the problem is that you have too many nested levels? would it help if we add 'else if' action parts (for testing conditions and values)? e.g. instead of

    if cond1=true then
    do something
    else
    if cond2=true then
    do something
    else
    if cond3=true then
    do something
    end if
    end if
    end if

    the structure would look like
    if cond1=true then
    do something
    else if cond2=true then
    do something
    else if cond3=true then
    do something
    end if


    In case the problem is that you want to do something depending on multiple conditions/values I'd recommend to use a "temporary" condition. e.g. consider the case where you want to execute something if cond1=true, cond2=true, cond3=false and val1>100. you could do something like this in the action editor:

    execute script:
    local condValue=false
    if getObject('Conditions[cond1]'):getBool(VConditionValue) and getObject('Conditions[cond2]'):getBool(VConditionValue) and not getObject('Conditions[cond3]'):getBool(VConditionValue) and getObject('Values[val1]'):getInt(VValueInt) > 100 then
      condValue = true
    end if
    getObject('Conditions[level1_finished]'):setValue(VConditionValue, condValue)
    

    if level1_finished=true then
    do something
    end if


    I'd not recommend all users to script everything. Especially users who are not coders and have no coding experience. The action editor is very powerful (although you don't seem to like it) and users who don't like to script should use the graphical UI and write scripts only for very advanced stuff.

    Great Poster

    378 Posts

  • #40, by afrlmeThursday, 07. August 2014, 13:50 10 years ago
    @ Alex: you need to edit you post! You've not closed off the quote properly or have added an extra one & it's broken this page. wink

    I would like in the editor if we could create if queries in the same way as lua query operators.

    if, and, or, else, elseif, end. It just makes more sense to me that way so that it is possible to string together multiple queries into one without needing an end if for each query & also same goes for the else vs elseif as elseif also allows us to query multiple things without needing to end each thing.

    Imperator

    7278 Posts