iTrafficCreation and iScriptedOrders

More
19 years 3 weeks ago #12705 by GrandpaTrout
Excellent! You made my day! It looks like the pilot setup had to be run. Otherwise, this does not look different than the code that complained of an invalid leader.

Feel like trying to make the pod spewer functions work?

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

More
19 years 3 weeks ago #12707 by Joco
Pod spewer functions? Sure I'll give em a go. errr - better tell me which package I should be looking at so I know I am not off on a false trail.

Cheers,
Joco.

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

More
19 years 3 weeks ago #12708 by GrandpaTrout
iHabitat.Spew has a function for exiting cargo pods from a pod spewer. But there is no function for docking pods to a spewer and then removing them from the game. So it is still a bit of a mystery how that is done. But it is worth figuring out how the code spews pods out first.

It could be the same function works two ways. If the pods exist and are nearby the station (like the ones loaded on a docked freighter), it will pull them in. If the pods are not yet placed in game, (or are very distant from the station) it spews them out. I don't honestly know, I am just thinking out loud about how I would have coded the function.


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

More
19 years 3 weeks ago #12710 by Joco
Have some progress.

I have the iHabitat.Spew function spitting out cargo pods. Just need to sort out how to associate the hcargo info with an cargo pod sim - unless that is info already understoad. Not perfect yet but some progress I think.

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

More
19 years 3 weeks ago #12711 by Cougaris
This is good stuff.

I'll be joining in all the whiz-bang as soon as I get a bit more familiar with the source packages and such.

I hope you won't mind me asking simple questions every so often. :)

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

More
19 years 3 weeks ago #12712 by GrandpaTrout

Originally posted by Joco

Have some progress.

I have the iHabitat.Spew function spitting out cargo pods. Just need to sort out how to associate the hcargo info with an cargo pod sim - unless that is info already understoad. Not perfect yet but some progress I think.


The following should do the trick. And Welcome to the forum Cougaris!
Code:
hsim CreateCargoPod(string cargo_name, string owner_faction, string cargo_faction) { hgroup pgroup; hsim pod; hcargo cargo; string sim_url; cargo = iCargo.Find(iInventory.CargoTypeFromName(cargo_name)); //sim_url = ECargoScript.CargoSim(cargo); // removing ecargo script temporarily, so use this default instead. sim_url = "ini:/sims/ships/utility/freightpod"; pod = Sim.Create(sim_url, cargo_name); if (none == pod) { pod = Sim.Create("ini:/sims/ships/utility/freightpod", cargo_name); } if (T_CargoPod == iSim.Type(iSim.Cast(pod))) { iSim.SetFaction(iSim.Cast(pod), iFaction.Find(owner_faction)); Object.AddIntProperty(pod,"cargo",iInventory.CargoTypeFromName(cargo_name)); Object.AddIntProperty(pod,"cargo_faction",iFaction.Allegiance(iFaction.Find(cargo_faction))); } return pod; }

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