Nexus Modding > Scripting

Scripting Issues

<< < (16/25) > >>

The Old Dragon:
Try this, it worked on my test range...


--- Code: ---RULE event Exploded

condition E.ship:class=#cls_missile

:action

       //Record the location data for the explosion...

EposX:=E.ship:PositionX;
EposY:=E.ship:PositionY;
EposZ:=E.ship:PositionZ;

                        //And tell what is is...

Debug("X Coordinate = ",EPosX);
Debug("Y Coordinate = ",EPosY);
Debug("Z Coordinate = ",EPosZ);

:end //end action

END //end rule
--- End code ---

Gave me valid data whenever a missile struck home  :)

jstubbles:
I'm having an issue right now where I'll tell a ship to engage a target, then the weapons power up part way, then stop. They do that over and over again, even though they are well within combat range of the weapon :( they eventually fire when they get even closer, but the AI fires long before my own craft would.

Their hitchancecat settings encompass both the combat and artillery range settings, but they still keep resetting each time, it's really odd. If I set them to manually fire, they'll fire without a problem

Mularac:
Are you talking about long-distance weapons? try setting (if you haven't already) their sets to the ones corresponding to an artillery weapon: Sets 2 4 30 100 31 (or 32) 117 ;

jstubbles:
They're combat weapons, not artillery weapons. In this case, they're missiles, which I'm not using as artillery. Problem is, if I give them a hitchange cat that only has settings for range 1, I cannot fire at range 2 (obviously), but the AI CAN fire at range 2 and I can do it if I manually fire them, which makes no sense at all.

Another funny issue I'm having right now is with the missile engines. For some reason, if I set the engine velocity factor to a value higher than 60, it makes both the flare and strip PULSE - even though I have pulsefactor set to 0 wherever possible.

Mularac:
Well, just to ask: when you say that you're only giving a hitchance cat for only 1, you meant that you left the other places as 0?

Guys, I've an interesting problem that's been keeping me for several hours...
In one of my missions I'm having the camera follow the trajectory of a missile as it heads towards a ship and then impacts on it, and what I've been trying to achieve is to move the camera to where the camboatview() cam was last at, the impact zone. My aim is to have a seamingless transition between that cam and the regular one (this is done in cinema mode. That's why I asked you if you could obtain the co-ordenates of a missile before it impacts the ship)

however, this is very tough since the only point of reference is the co-ordinates of the missile as it explodes, and you can't obtain it's co-ordinates a sec before (I know, a tick rule, but that's a bit too risky).
Using the ship where it collides as the 2 reference is the closest I've got, but it's far from ideal...

so... ideas?


EDIT: Man, I love this site.... solved :P
The tick rule was the answer, after all. It saved the missile postions as long as it was alive, every sec. And then, using the exploded rule (thanks Old Dragon) used a camMoveTo command, using the last known position of the missile from the tick rule as the "from" co-ordinates, and then I used the co-ordinates that the exploded rule gave to me as the "to", and using a handy explotion to shake the screen a bit and soften the transtion, worked like a charm.

EDIT: Either way, I have an other issue, how did you create a wreckyard again? I tried setting the wreck ships as asteroids, but that's far from ideal. And if I just leave them as objects  and then "wreck" them with behaviour:=2, the game crashes due to too many ships (currently have about 30 wrecks :P)
So how did you do that again, Old Dragon, if I may ask?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version