Bridge Commander Central
BC Forums => BC Scripting => Topic started by: Cube on August 25, 2007, 01:17:01 PM
-
Hi, just a quick question.
1.Is it possible to turn collisions off on one object in a system? (So ships can fly through it, but without turning all collisions off).
2. Would it also be possible for the object to cause damage to ships that fly through it?
If so, how?
Edit: Looks like I'll have a few more problems.
3. In the system script it has a number for the size of the planet. Is this number simply how many times bigger the object is? (So, if you imported a planet, make it 241 times bigger, then exported it; would it be the same size as the normal planet model with a size of 241?)
4. Is there a work-around for the limit of display for distance away from objects?
-
I had this idea too. I had an idea if you had a non-collidable object in space, you can add detail to asteroid belts, nebulae, spacial anomalies, etc. I would like to know this too. :)
-
It's possible.
Say, you have a planet in variable pPlanet1 (the same works for otheres, such as ships and asteroid fields, remember, E5/6 with the Kessok/Cardassian conversation?), then you can make it not collidable through:
pPlanet1.SetCollisionsOn(0)
There is another way, through the ProximityManager (more on this in a moment):
pSet.GetProximityManager().RemoveObject(pPlanet1)
I think they mean the instance, since AddObject works that way (RemoveObject doesn't appear to be used).
Be sure to create the proximity manager, via pSet.SetProximityManagerActive(1) it's possible that this is already present in your system.
Number 2 will have to be done through a ProximityCheck, look through scripts/Maelstrom/Episode6/E6M3/E6M3.py and E6M5.py, for the function def CreateProximityCheck(pPosition).
You can also look in MissionLib.py, but I think you'll find that the above scripts will do what you want, but be sure to create your own Event Type (the ET_* value).
If you want to have a moving, uncollidable, damaging, object, then you can attach the thing returned by App.ProximityCheck_Create to said object through pMovingThing.AttachObject(pProximityCheck).
Then, in the function you registed the ET_* to (you did do that, right?) you get the object that the proximitycheck found through App.ShipClass_Cast(pEvent.GetDestination())
And if the result is not None, then you can do this:
pHull = pShip.GetHull()
pShip.DamageSystem(pHull, <<YourDamage>>)
Where <<YourDamage>> is a number between 0.0 and some maximum damage.
This assumes that the result of App.ShipClass_Cast(...) is stored in a variable called pShip
Also, be sure to put at the bottom of your trigger function pObject.CallNextHandler(pEvent) or any futher events may not be triggered.
If you have any specific problems for the above, then please ask, it's just currently a bit too late for me to provide examples for all, and those may not be entirely usefull to learn from anyway.
For your 3rd question, I would think that the first number is the scale (since planet nifs loaded as ships are rather small), so if your planet model has a size of 241 and you put in the number 100, then the resulting model would be 24100 "units" in size.
Last question, I think increasing the SetSphereRadius of the backdrop could do this, I suggest you search the BCS forums for this, since it originated there.
-
Thanks, I'll have an attempt at it tomorrow.
-
About question 3:
if you mean the first argument of the App.Planet_Create function, then it is the radius of the planet in game units.
For example, look at this, from Belaruz 4:
pBelaruzPlanet = App.Planet_Create(180.0, "data/models/environment/AquaPlanet.nif")The 180.0 there is it's radius. the conversion of game units to kilometers is something like 1km = 6 game units... tho to have sure, you can use this:
App.UtopiaModule_ConvertGameUnitsToKilometers(<<game units value>>)
App.UtopiaModule_ConvertKilometersToGameUnits(<<kilometer value>>)
-
Still, doesn't it not scale the nif?
-
Yeah probably. After all, what would the game do if you get that same line for example, and instead of 180.0 you put something like 5000.0 ? The model should be quite bigger in game.
So I think it scales the model yes, but by the game units, not by a multiplier of some kind to the model's "real" size.