Can't edit the script to add an extra condition.
Brian123
01 Feb 2015, 01:13I noticed that once I have added a condition then start to add the actions for the condition there does not seem to be any way to add an extra condition.
If example :
if player is carrying a certain object the print message.
Then if I have forgotten to check if a flag is set as part of the conditions I can't find any way of adding this extra condition apart from deleting all conditions and starting over again.
Is there a way or does Quest lasking in providing a way to add extra conditions?
Brian123
If example :
if player is carrying a certain object the print message.
Then if I have forgotten to check if a flag is set as part of the conditions I can't find any way of adding this extra condition apart from deleting all conditions and starting over again.
Is there a way or does Quest lasking in providing a way to add extra conditions?
Brian123
Silver
01 Feb 2015, 02:09You can add/remove flags, add attributes (sort of the same but with this you can add values) or you can simply do some back stage theatre and substitute objects for new ones. Can you give a specific example of what you're trying to do?
jdpjdpjdp
01 Feb 2015, 06:35If I am understanding your question (and I'm not sure I am), your problem is that you are nesting "if" statements, only to realize that what you've written needs to go INSIDE another "if" statement you forgot to account for.
If that's the problem, it's easy enough to fix. Just go into the code view and copy the part you've already done. Once it's copied, delete, then create the "if" statement you needed to be around it. Once that's in place, just paste the copied code back in wherever it's now needed. Very quick and easy to do. If you don't know how to do things with code view, we can walk you through it (it's not difficult, and will make a lot of things a lot easier going forward).
If that's the problem, it's easy enough to fix. Just go into the code view and copy the part you've already done. Once it's copied, delete, then create the "if" statement you needed to be around it. Once that's in place, just paste the copied code back in wherever it's now needed. Very quick and easy to do. If you don't know how to do things with code view, we can walk you through it (it's not difficult, and will make a lot of things a lot easier going forward).
HegemonKhan
01 Feb 2015, 08:14you can add new scripts, move them up and down, copy or cut, and paste, if you want to do it through the GUI~Editor, but make sure that you click on, and do, everything right (it's pretty confusing and annoying to try to do this stuff correctly via the GUI~Editor, as it's better to try to learn to edit within the code, but if you're staying to just the GUI~Editor, I highly recommend you back up your game file first, as it's very easy to mess up and lose your entire scripting blocks... laughs, HK whistles and looks away).
Brian123
02 Feb 2015, 02:50Good advice. I test something out then if it works I save the script. I have been caught out with making a change, getting an error then not being able to fix the error (even when removing the change made).
Someone asked for and example
1. If door is player has key then unlock door and display 'you unlock the door
What I should have entered was
2. If player has key and the door is locked then unlock key and display 'you unlock the door
So the problem is in adding the additional condition for checking that the door is locked.
Once you have added the action then you can't change the conditional test.
It would be a useful addition to add to Quest in the future in making it possible to alter a test condition.
Also I think you can only AND two conditions and not OR them however you could create a separate test and action with a ELSE IF
But you are right in that I do need to get to know the script code better so I can modify it in code view.
Brian123
Someone asked for and example
1. If door is player has key then unlock door and display 'you unlock the door
What I should have entered was
2. If player has key and the door is locked then unlock key and display 'you unlock the door
So the problem is in adding the additional condition for checking that the door is locked.
Once you have added the action then you can't change the conditional test.
It would be a useful addition to add to Quest in the future in making it possible to alter a test condition.
Also I think you can only AND two conditions and not OR them however you could create a separate test and action with a ELSE IF
But you are right in that I do need to get to know the script code better so I can modify it in code view.
Brian123
HegemonKhan
02 Feb 2015, 04:28the 'nesting~indenting~layering' is very confusing in the GUI~Editor, for me anyways:
1. it's hard for me to line up (vertically) the indenting with the correct circular 'add a script' button... laughs (I'm getting old, my eyes are bad)
2. it's hard for me to click on the right box segment that I want to copy~cut and paste (move to where it should have been placed).
3. and etc difficulties... lol
editing in~with code, is so much much easier... though you do got to understand the code structure in order to do so too, but it's not that hard...
see Pixie's link, or somewhere... I made a detailed post trying to explain it... not that this helps much... be too hard to try to find it now... lol
1. it's hard for me to line up (vertically) the indenting with the correct circular 'add a script' button... laughs (I'm getting old, my eyes are bad)
2. it's hard for me to click on the right box segment that I want to copy~cut and paste (move to where it should have been placed).
3. and etc difficulties... lol
editing in~with code, is so much much easier... though you do got to understand the code structure in order to do so too, but it's not that hard...
see Pixie's link, or somewhere... I made a detailed post trying to explain it... not that this helps much... be too hard to try to find it now... lol

jaynabonne
02 Feb 2015, 07:37The problem is that you can't do multiple conditions as easily as you can do one. For example, I assume that in your sample above, you had done something like:
if [player is carrying object] [object] key
Then
You can always go back and change the "player is carrying object" back to a generic "expression" and then set your more complex conditional.At least, I can in the desktop version. Are you using the desktop version or the online version? (Sorry if I missed that.) In fact, after I change the type back to "expression", it actually shows me what the resulting expression was for "player is carrying object key" as "Got(key)".
Also, you can AND, OR and NOT conditionals to your heart's content:
if [player is carrying object] [object] key
Then
You can always go back and change the "player is carrying object" back to a generic "expression" and then set your more complex conditional.At least, I can in the desktop version. Are you using the desktop version or the online version? (Sorry if I missed that.) In fact, after I change the type back to "expression", it actually shows me what the resulting expression was for "player is carrying object key" as "Got(key)".
Also, you can AND, OR and NOT conditionals to your heart's content:
if [expression] (player.alive and not player.haskey) or player.isreallygood