OFPEC Forum
Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: SnowSky on 27 Feb 2009, 10:16:09
-
Hey,
do you know how to manage the problem with createVehicle Instruction, if there is a playable unit near you?
I try to explain my problem with an example. I wrote something so that I can build ingame some Buildings alà Warfare. Now if my mouseposition with the building (set by createVehicleLocal) strafes me, I become injured or even worser, it kills me. Till now I did a WorkAround with the boundingBox, so that if a unit or building is near the mousepointer, the position of the building is set to [0,0,0]. The next problem is, that I set the maximal value of the boundingBox [[minX,minY][maxX,maxY] as the radius so where I watch for nearestObjects. Sure it works fine with units because they aren't so huge and giant so they don't die anymore at the moment, but if I built another house, I'm able to set the new building into the other building. Do you have an Idea how this has been managed in CTI or Warfare?
-
You may be interested in a couple of the solutions I was given to a mobile-spawn idea in this thread (http://www.ofpec.com/forum/index.php?topic=32966.0), regarding intersections with buildings.
-
In Warfare there are special models for buildings (the transparent green and red ones) that don't damage vehicles (including units) on collusion.
The following code is used to check if there are any buildings near by:
... _obstacles = NearestObjects [_mousePosition,["Building","WarfareBCrate"],17] ...
-
thank you for your Post, I read it. I'll try to handle this problem with a messy function which will take all objects near 50m in its array, then I will check each objects size, and if the distance of the object to my mousepointer - objects maxSize - myPlacements maxsize is bigger then 1.5 meters, it will check the next one. Now I'll try to realise this, I hope it won't crash the performance to much.
+@Worldeater, thanks, I saw this already, but didn't know that these "specialBuildings" (green and red) don't have a CollisionModel, you opened my eyes.
-
In Warfare there are special models for buildings (the transparent green and red ones) that don't damage vehicles (including units) on collusion.
Ahh, well that's definitely worth knowing! :good:
-
Hey, ahm - I still have a Question. What happens, if I do setpos the House created with createVehicleLocal on AI units, they don't get hurt, but I become injured. Does this happen only to the Player who executes the createVehicleLocal, or all humanPlayers?
Huhu :clap: - Hey Guys,
"proudly" I made a solution which was a bit... messy - but it looks like it would work without a high amount of power :). If any one is interested, just tell me :)