iTrafficCreation and iScriptedOrders

More
19 years 2 weeks ago #12799 by EricMan64
If you want a difficult one that I've been messing with on and off for a few years, you can always see if you can find out how to link ship weapons together. iMultiplay.LinkWeapons (or whatever) has always been our only method, but if you try to call that on a ship with any number of beam weapons, the game crashes to desktop. Ever since I designed my hanger loadout code, it's been a sort of holy grail for me to be able to link weapons on ships that have beam weapons. There are some weird things to be noticed about ships with linked weapons. Mysterious objects of a class something like fcLink start appearing attached to the ships. I think we discussed it once on this forum, but I'd have to look around to find the thread.

Please Log in or Create an account to join the conversation.

More
19 years 2 weeks ago #12800 by Joco
Ok - I have an alpha version of the pirate system. I have code detecting if the player ship is likely to be escorting other ships and setting an LDS disrupt based on some random factor.

Next stages will add some more smarts to the code to determine if an ambush should be initiated. As well as providing a standard pirate attack group and a hook for a customised attack group (I hope).

:D

Please Log in or Create an account to join the conversation.

More
19 years 2 weeks ago #12805 by MajorTom

Originally posted by GrandpaTrout



I wanted the player to be able to remote pilot cargo pods and dock them to his own freighters etc. But (if I remember correctly) the player gets trapped forever in the remote pilot connection once the pod docks. You could write a player watch loop that looks for the condition where the player is remote piloting a docked cargo pod (or a dead or dying sim) and moves the player back into his prior ship. There are some iRemotePilot function calls to find out the players prior ship. You might have to set the player pilot back in the ship directly. If this cannot be done, some other cargo handling method will need to be invented.


In the Epic Online scripts we found that, since freighters manouver very slowly
(and the pods may be moving rather fast), it's fastest to move your freighter
close to the pods ( 1 to 2km) and them dock them to the freighter per remote
link. You don't need anything fancy to do it:

When you create the pods (debris) call:

iRemotePilot.EnableRemoteConnection( iShip.Cast(cargo_pod), true );

That will work on anything that is a type T_cargoPod (which is derived from icShip)
and you can use the normal comms menue on the hud to establish the remote link.

Important to note: if the pod is destroyed for example by AI enemies or a
station when you are in remote mode the game will crash so its best
(for the duration of the remote link) to set:

iSim.SetIndestructable( iSim.Cast(cargo_pod), true );

Alternativly, You should be able to (I haven't tried it) call:
iRemotePilot.DeactivateConnection(); in the cargo pods death script.

It is true that you get "stuck" in the pod when you've docked it to
something (You can undock again, but can't call up the Hud menue
to disconnect the remote link while docked). That is however easy to fix.
You just need a simple while loop that "waits" until the pod is docked.
Then just call:
iRemotePilot.DeactivateConnection();
That will pop you right back into the ship you were in when you made
the initial connection.

There is also a very good command to use for special situations where you
may want to remote link to something automatically or key bind (by pog)
in the Single play game, it's :

iMultiplay.RemoteLinkTo( hship );

to deactivate the remote connection you can just call:
iRemotePilot.DeactivateConnection();
i.e. You never need to use the iMultiplay equivalent which is:
iMultiplay.SeverRemoteLinkTo( hship );
(that is intended to cut the link on both server and client in a multiplayer environment)
****
It took about 30 hrs of trail and error pogging to
figure all that out but you can try it out in the
Epic Online Mod if you wish :D
The MP scripts are event based so they wouldn't be very helpfull
to do what you want but the principles are the same as above.

Iwar2 Multiplayer Fan Site

Please Log in or Create an account to join the conversation.

More
19 years 2 weeks ago #12806 by Joco
This docking of pods via a remote connect - which is essentially docking them by hand. What is the benefit in doing this? Would it not be better/faster to have an automated system like the Jafs scripts? Or some variant of it?

E.g. remote connect to the freighter and then using targeting and a custom key binding start pods docking them seleves to the freighter. Or is that not technically possible for some reason? That way you could set up a whole lot of pods to dock to the remote connected ship in one hit.

Please Log in or Create an account to join the conversation.

More
19 years 2 weeks ago #12807 by MajorTom

Originally posted by Joco

Would it not be better/faster to have an automated system like the Jafs scripts? Or some variant of it?

E.g. remote connect to the freighter and then using targeting and a custom key binding start pods docking them seleves to the freighter. Or is that not technically possible for some reason? That way you could set up a whole lot of pods to dock to the remote connected ship in one hit.


It should/could be possible. You could probably install a AI pilot
in each pod and give it order to dock to the freighter the player
is in (be it either directly or per remote).

It might be less fun (less immersive) though. It would be more
like you're doing something for your money if you have to dock the
pods manually. Also, you might want to set up other chunks of
orbiting (possibly explosive?) debris that are in the way and you
would need to steer around them to get your booty home safely. Might
be more realistic and immersive if some work (and danger) is involved.

Obviously, some may think it's more fun to just sit back and watch
while the debris automagically docks for you. A matter of preference.

This is a classic example where pog interfaces with game design.
It's your game and you can design it however you want. ;)
Just have fun doing it. :D :p


Iwar2 Multiplayer Fan Site

Please Log in or Create an account to join the conversation.

More
19 years 1 week ago #12808 by Joco
Slowly working through this pirate thing. I have the disrupt code working and I seem to have it reliably disrupting the player and all ships in an Xkm radius sphere around the player. There will always be the potential for some ships to "get away" as they might be just outside the detect/effect sphere for the ambush. This is a "real life" situation I would think.

However if anyone has ideas on how the detect sphere should treat ships not quite inside it please let me know.

Cheers,
Joco.

Please Log in or Create an account to join the conversation.