theblackpixel Posted November 2, 2022 Author Share Posted November 2, 2022 I don't think you would need a magelight. Just place some xmarkers and calculate the distance between that and some marker or other object on the prow of your ship. You might have to have a check for direction as well so passing beside something wouldn't trigger a collision. Or could you use trigger boxes and OnTriggerEnter to check for collisions? That might also catch side swipes....I can't believe I did not think of using OnEnterTriggers. I wonder when they trigger, it might be that the origin of the character triggers it, which would mean that only once the middle of the ship is in the trigger it would detect a collision, but that would be an easy fix. If having a lot of them does not hamper performance too much that is definitely a method which I could see working, I'll give it a go! Link to comment Share on other sites More sharing options...
greyday01 Posted November 2, 2022 Share Posted November 2, 2022 I believe OnTriggerEnter also triggers for items not just characters. If you have some items like static shields on the sides of the ship that move along with it, you can have a condition on the script that looks for those only. If you had the ship itself triggering it, it might only trigger when its center point enters the box. Does your ship only go straight ahead, or can it turn? Maxarturo said collisions don't work while translating. You might need to translate only a very small distance then check for a collision then repeat as needed. Link to comment Share on other sites More sharing options...
greyday01 Posted November 3, 2022 Share Posted November 3, 2022 I don't know if this is possible. Can a triggerbox be sized to fit over the boat and be attached to the boat so they move together. The OnEnter event could then be triggered by the box moving into the obstacle instead of having a triggerbox over each obstacle. That would eliminate the problem of the boat size. Link to comment Share on other sites More sharing options...
maxarturo Posted November 3, 2022 Share Posted November 3, 2022 (edited) Ok, I now understand, before you weren't very clear. Skyrim's and its assets weren't build to support such applications, you need to take in account that is Gamebryo Engine and not CryEngine. At the moment I can think only 2 ways that this can be achieve, and both have issues. 1) Placing trigger boxes (as greyday01 suggested) that will react either to the player or the movable static ship, the trigger boxs will need to have assigned the corresponding 'Layer' if it is to react to the movable static, the trigger boxes will set either: a - (OnTriggerEnter) a Global Variable that the ship's script will listen to, and if the global variable is set to '1', then only backwards movment is possible. OnTriggerLeave = the global is set back to '0'. b - Access the ship's script (the Master Controller script) to change a 'Bool' that its use is exactly as above. * The difference of the Global Variable and the Bool, is that the Bool is faster and more reliable, especially if it will be used on a script that will need to check and / or retrieve that information fast and repeatedly, which I assume your ship's script will be doing. EVENT some event... RegisterForUpdate() ENDEVENT EVENT OnUpdate() If (AllowForwardsMovment == True) ; Forwards Movment allow TranslateToRef() Else ; AllowForwardsMovment is False NoForwardsMovmentMSG.Show() TranslateToRef() ; Backwards Movment ONLY EndIf RegisterForUpdate() ENDEVENT * Primary Disadvantage: If you have a really big island you may end up with a billion trigger boxes all around the island coasts. 2) Using almost the same logic but instead of trigger boxes, you will need now to named every single 'wilderness' cell (give each cell and ID) to create a 'Naval Navigation Grid' that the 'Master Controller' script will use to obtain information on its current position/location and where is allow to travel. * Primary Disadvantage: If you have a really big island and your worldspace has a lot of cells, the script may cause lag (translation delay) depending on the straight of the pc the script is running, since it will need to retrieve that information on every 'translation' attempt, and that 'retrive information' could be checking from a couple of cells to hundreds of cells depending on the worldspace. ........................................................................................................................................... There is no need to thank me my friend, and I have absolutely no interest at all in supporting Nexus, I only continue to provide assistance, share knowledge and knowhow in this platforms for these 2 simple reasons: 1) Modders and especially the less experience ones don't need to pay for other people wrong decisions and mistaken policies. * I was absent from this forums for a year +, then I realized that I was also contributing in the decay of the modders community by not helping modders evolve their capabilities. 2) It's the only way to create better future modders. Edited November 3, 2022 by maxarturo Link to comment Share on other sites More sharing options...
maxarturo Posted November 3, 2022 Share Posted November 3, 2022 I don't know if this is possible. Can a triggerbox be sized to fit over the boat and be attached to the boat so they move together. The OnEnter event could then be triggered by the box moving into the obstacle instead of having a triggerbox over each obstacle. That would eliminate the problem of the boat size. The vanilla poisonbloom plant is created in such a way, it has a sphere collision surrounding the plant that it's set up to act as a trigger box, so the plant can run an 'OnTriggerEnter()' & 'OnTriggerLeave()' event, but it's a little tricky to create, since you need 2 collisions in the ship, the ship's collision and the outside collision which needs to be a little bigger than the ship so that the object entering the collision trigger can fire the script. This could be another approach, that the ship will be listening to 'invisible' markers that will be positioned as borders. But this also needs some tricky scripting, and a general set up. Link to comment Share on other sites More sharing options...
Recommended Posts