where g1 is the VLS and t1 is the target. The VLS will fire but the missile goes straight up without ever turning to fly towards the target. I want this event to occur with scripting only with no player interaction. I remember there being some way to get this to work where the missile would fly to the target but I have since forgotten. Any ideas? Thanks in advance
Never mind guys, figured it out. For vehicles that launch missiles the missile will only fly towards the target if their seeker can acquire the target. The Venator missile used has a laser semi active homing system meaning you have to launch it at something being designated by a laser. I used a remote designator g3 to mark the target and used the script
side matters - ie. if your target is opfor (east) then the above setup and code would work. if your target is blufor (west) you can put an opfor unit in the Mk41 turrent and you would have the change the side in the trigger code to be east - ie.
Just tried again. Still getting exactly the same error report " On activation Type Bool expected Nothing " when I try to put that code in the trigger on activation box. This is driving me nuts. If its working for you its clearly something really simple but not obvious. I know the first two lines of the code are fie because when i just run them and take control of the VLS it shows that the VLS has picked up the target t1. I don't suppose you could post a link to a really simple mission setup with a vls, player, target and trigger where this is working for you? I just can't see any difference between the code im posting for the third line and your third line yet the trigger just wont accept mine!
If you look at my post above, You'll discover that you fell victim to the same bug..or perhaps you might have. If you've copied the code from YOUR post, it contains one of the red dots that prevent it to work. If you copy-paste the code from @theopolus post is "clean" and working. Tested.
I really wish that was it but its not. The bug would impact the first two copied lines as well but it doesn't and they are accepted by the trigger without issue. Ive tried typing the code in fresh rather than doing a copy and it still doesn't work and I get exactly the same error report when I put that third line of code in the activation box. It was the code from @thepolus that I copied and posted btw. Then I tried just straight typing it in. Its infuriating. I realise you have it working but I'm at a complete loss now as to why I cant get the trigger to accept that third line of code. You couldn't post a simple mission setup could you as above? That may help me work out why its working for you and not for me. Pulling my hair out now in frustration.
Bizarre. I can execute that third line of code in the debug code box when I pause the game and it runs without error and a missile is fired. But when I copy that very same line of code from that code execution box back into the trigger I get the same error report as before. So the code works fine when executed from the debug console but reports an error when the exact same code line is put in a trigger. Eh?
Btw, while I was testing it out i had the same initial error that you reported - Bool error. Then i realised that i had forgot to name the targets (ie. i hadn't gone in and named them "t1" and "t2" in the variable name field). Not sure if that was your issue but this example mission works flawlessly.
Many thanks @theopolus. Your mission as you said works fine. I cant at this point see any difference between the code in your triggers and mine. Going to try just to copy your code from the triggers now and put it into fresh triggers in a new mission and double check that works. Many thanks for the help.
Ok I see a difference in the way yo are using the code. You have the code wrapped in a call block in your two radio triggers. Im assuming that is allowing the trigger to accept the third line of code which is throwing the error when i try to put it in as simply part of three lines of code to be called on activation. The call wrapper seems to prevent the error? I wonder why that is - any ideas?
saw that later, but for clarification, when you get an error like: Type Bool/string/number/anything else... expected Nothing as error in on activation (or init) field of trigger/objects, that means you face to the known limitation (editor, not scripted sqf) kept by compatibility (I presume). In this case, your code needs to return... nothing.
That's really helpful Pierremgi. I had been thinking about it last night and started to realize that it was something to do with there being a return value when there probably shouldn't be. Your explanation is very helpful and much appreciated. I hadn't realised that this was an issue with how the trigger boxes handle code. Ive had problems like this occasionally before and it makes sense now.
I have this laser script for a ship and I am trying to make it kill an enemy when it is hit with the line rendered laser. How can I achieve this. All things I found online I just could not get to work. An outline of the code would be (this isnt real code).
LineRenderer is not your friend here. While you can somehow make it work (you would need to dynamically create and update the colliders by code), that is not something you want to do. (As reference -for-line-renderer.html)
If you want to use your laser to kill something, it is just a bunch of stretched shiny bullet packed together. All you need to do is create a small laser prefab with an image of your laser and you spawn them in quick succession. Each of those laser bullets can have their own collider and therefore your collision/ die/ kill etc call.
With a bullet prefab, you can for example easily move your ship, continue shooting and you don't care about already shot bullets. The line renderer would just stay where it is. You will have a really hard time to update it to match your movement pattern of the ship.
It is a script animated obstacle. It is animated with a script that progresses animation stages as the player gets closer. For example, in the level Digital Matrix, the Air Crusher obstacles' blades can spin forever because the ball is at a certain distance. The scripts use a percentage calculation to do this. The laser is one square unit, but if it activates, it will be 39.5 units in length including the beam, meaning the beam is 38.5 units.
The two eyelids of the laser slowly drift apart as the laser prepares to fire. White particles can be seen escaping from the gap left by the drifting eyelids. The laser fires when the ball is 5 tiles away. The white particles disperse when the laser fires. This can introduce a theme change in a level.
When a mover tile is activated with a laser on it, the laser visually moves but the hitbox does not, which makes it possible to go through the visual beam, but your play will die if you enter the block where the laser beam used to be. This glitch happens in the following levels, Sci-Tech at 19%, in E-labyrinth at 66%, in Halloween Night/Varying Christmas at 69% and in Circus at 11%. This glitch also happens with any obstacle which has a hitbox greater than a 1x1 tile, unlike in Bouncing City at 8%.
I need to know how light is reflected on the objects given a fixed spot as light source. The best way would be to render a laser beam, however such laser beam is not easy to design/render and heavily depends on the rendering engine. So I need a more easy possibility to check. Do you have an idea how this could be achieved?
I don't have enough reputation to comment on the Leander post.I've modified the script to have several rays. It's naive and rusty, but there's an important detail - if you get your evaluated_depsgraph_get() every time you call a ray, you'll get stack overflow in Blender.The rays on the screenshot are displaced manually, script doesn't do that.Trees models by reymarch.Other than that fix, the rest modification is pretty trivial:
Raycasting is an essential subject in 3D games. With raycasts we can detect if and what kinds of objects are in our line of sight. This can be used for detecting enemies or how far an object really is.
This script sends out a raycast from the weapons barrel and sends it to an endpoint a little further. We check if we hit something along the way. If we do, we calculate the distance between the weapon barrel and the hit point. We then scale a laser to that distance to visualize the actual raycast. Depending on the collision group and filters, some objects are ignored.
In our first script, the raycast returns to us as soon as it hits the first object along its path. We can also send out a raycast to an endpoint, and let it return to us when it has reached its endpoint. It gives us back a list of objects that it has hit along the way. This list can be empty but also exists out of various objects. Depending on the collision group and filters, some objects are ignored.
3a8082e126