iTrafficCreation and iScriptedOrders
- GrandpaTrout
- Offline
- King of Space
19 years 7 months ago #12705
by GrandpaTrout
Replied by GrandpaTrout on topic iTrafficCreation and iScriptedOrders
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?
Feel like trying to make the pod spewer functions work?
Please Log in or Create an account to join the conversation.
19 years 7 months ago #12707
by Joco
Replied by Joco on topic iTrafficCreation and iScriptedOrders
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.
Cheers,
Joco.
Please Log in or Create an account to join the conversation.
- GrandpaTrout
- Offline
- King of Space
19 years 7 months ago #12708
by GrandpaTrout
Replied by GrandpaTrout on topic iTrafficCreation and iScriptedOrders
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.
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.
19 years 7 months ago #12710
by Joco
Replied by Joco on topic iTrafficCreation and iScriptedOrders
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.
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.
19 years 7 months ago #12711
by Cougaris
Replied by Cougaris on topic iTrafficCreation and iScriptedOrders
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.
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.
- GrandpaTrout
- Offline
- King of Space
19 years 7 months ago #12712
by GrandpaTrout
The following should do the trick. And Welcome to the forum Cougaris!
Replied by GrandpaTrout on topic iTrafficCreation and iScriptedOrders
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.