Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Presently, my character is limited to how high he can climb, as he's supposed to NOT be able to climb the mountains until a specific condition is met (the number of hints he's collected, per the storyline for Stage 1). The javascript file works great, as is, where it is. The problem is, I don't know how to cancel out/delete that javascript file at the time needed. And, if I remove that file from the Luposian node, using just the code itself from the javascript file doesn't seem to work, when I try to use it as a condition. I sense I'm either doing something wrong or not doing something right (same difference?
Obviously, if this single javascript file contained the condition "until Book5/Hint5 is picked up, limited height. After Book5/Hint5 picked up, remove limitation", that would be ideal, but I haven't a clue how to code that (blind kitten, meet tornado). I was able to EDIT the existing code to suit my needs, but changing it is my problem. |
||||
|
This script attach to some Node but not to the player. Now if you want to disable this script you can just delete that Node you attached this script to. With this script you need to specify the player.. ( before you attached it to the player but now you can attach it anywhere you want but you need to specify the player.. There is multiple ways how to make this happen but this is probably simplest for you currently. // The following embedded xml is for the editor and describes how the behavior can be edited: |
||||
|
The javascript file is attached to the Luposian player node. If I delete that node, I have no character! So, that doesn't seem to be the right approach. How do we set up a condition that enables the height limitation until another condition is met, as I mentioned before? Or maybe I'm misunderstanding what you said. But what "player" node do I create that I can easily delete at any time? Would that be, like a book or 2D overlay, like what I've done so far? I've incorporated the new version, but unless I assign cNode to "Luposian_Player", there is no height limitation effected. So, obviously I don't understand how to use this (i.e. I'm doing something wrong). How do I conditionally delete a javascript behavior file, that's in a list of my character's behaviors? Removing a scene node, that I got. I can do that conditionally (as I've done with the books/hints), but how do I assign my character to a scene node (or vice versa) and the height limitation behavior to it, so that my character is height limited (unable to climb the mountains), until I delete the scene node? Assuming I'm understanding how you're supposed to be able to use this version of the javascript file. |
||||
|
Make a cube.. attach script to that cube (my version of script) Now first input for behavior is a scenenode- put player into it. Second is threshold third is slidespeed if you dont need height limitation anymore then just delete this CUBE..and behavior will be deleted with the cube. cNode you must assign to Luposian but dont attach script to Luposian.. then you can delete node with script. You can make it if last book appears then delete node with script and then its done. |
||||
|
wrote: Make a cube.. attach script to that cube (my version of script) Now first input for behavior is a scenenode- put player into it. Second is threshold third is slidespeed if you dont need height limitation anymore then just delete this CUBE..and behavior will be deleted with the cube. cNode you must assign to Luposian but dont attach script to Luposian.. then you can delete node with script. You can make it if last book appears then delete node with script and then its done. So, do I need to create a new cube or can I use one of the already existing cubes in the game? So I add the behavior to the cube and then assign Luposian to the behavior? And Luposian won’t be able to climb the mountains as long as the cube exists? And then, when I want to stop the behavior, I simply delete the cube? |
||||
|
Yes. You can use whatever node you want that you can afford to delete. |
||||
|
wrote: Yes. You can use whatever node you want that you can afford to delete. I tried using Book5 (scene node), but upon doing so, I was able to climb the mountains, as though the limitation wasn't there. It would have been perfect, because I actually destroy (delete) that scene node (along with the hint (a 2D overlay)) after the last hint is shown. Then I attached it to one of the cubes (which are always visible) and now Luposian CAN'T climb the mountains. So, apparently, the scene node has to be VISIBLE, in order for the attached height limitation behavior to work. Is there a way to use this height limitation behavior with invisible scene nodes the same as visible scene nodes? UPDATE! I've just verified it definitely works with the visible cube scene node! Yay! I set the delay of node deletion to 250ms, to insure almost instant availability to mountain climbing. Just need to know if I have to work around the visible node issue or if I can actually use invisible nodes. |
||||
|
If node invisible then scripts that is attached to it is stopped. You can keep your books visible-but place them at position where player never see them (for example under the terrain) If you choose CUBE to be storage of this script then you can make it invisible by setting transparent texture to it.. so its not visible but its there. -or set its scale very small. Also you can make a folder and use it as storage of script.. (so there is no 3d object in scene at all. |
||||
|
wrote: If node invisible then scripts that is attached to it is stopped. You can keep your books visible-but place them at position where player never see them (for example under the terrain) If you choose CUBE to be storage of this script then you can make it invisible by setting transparent texture to it.. so its not visible but its there. -or set its scale very small. Also you can make a folder and use it as storage of script.. (so there is no 3d object in scene at all. I went with the first choice. A nice, elegant work around. You can't see the book, yet it's (quite literally) under your feet. |
||||
|
|