AI landing in hangars not working
Moderator: Moderators
13 posts
• Page 1 of 1
- CT108
-
- Posts: 186
- Joined: Mon Aug 22, 2016 6:20 am
- Location: Dantooine
- Projects :: -Secret-
- Games I'm Playing :: SBF2 - Empire at War
- xbox live or psn: Captain CT108
AI landing in hangars not working
Hello guys,
I've been trying to set up the gunships so they can land in hangars, but it's not working. I know there's several tuts here but I can't get out of it
So,
In ZE I've
-Set up a path named EntityPathLand1 with these properties :
* Type - EntityPath
* Class - Transport
* Direction - 1.0
-This path is in the layer ass_paths
-The region where the gunship is supposed to land is named Land1, and the class properties is Land1 too
In spa8g_cmn.lua
In spa8g_ass.lua
Debug log (removed some parts due to the character limit, if you want the whole debug go here https://drive.google.com/open?id=1PixB5 ... zss6bURIOz )
As you probably noticed I'm trying to do that on the game's space Hoth map.
Help^is appreciated, thanks !
I've been trying to set up the gunships so they can land in hangars, but it's not working. I know there's several tuts here but I can't get out of it

So,
In ZE I've
-Set up a path named EntityPathLand1 with these properties :
* Type - EntityPath
* Class - Transport
* Direction - 1.0
-This path is in the layer ass_paths
-The region where the gunship is supposed to land is named Land1, and the class properties is Land1 too
In spa8g_cmn.lua
- Code: Select all
ScriptCB_DoFile("setup_teams")
EnableFlyerPath("Land1",1)
In spa8g_ass.lua
Hidden/Spoiler:
Debug log (removed some parts due to the character limit, if you want the whole debug go here https://drive.google.com/open?id=1PixB5 ... zss6bURIOz )
Hidden/Spoiler:
As you probably noticed I'm trying to do that on the game's space Hoth map.
Help^is appreciated, thanks !

Last edited by CT108 on Mon Jan 22, 2018 1:52 pm, edited 3 times in total.
- Marth8880
- Resistance Leader
-
- Posts: 5229
- Joined: Tue Feb 09, 2010 8:43 pm
- Location: Edinburgh, UK
- Projects :: EVERYWHERE + Zero Munge + TCW
- Games I'm Playing :: The Forest
- xbox live or psn: Marth8880
Re: AI landing in hangars not working
Debug log would also be helpful. 

- CT108
-
- Posts: 186
- Joined: Mon Aug 22, 2016 6:20 am
- Location: Dantooine
- Projects :: -Secret-
- Games I'm Playing :: SBF2 - Empire at War
- xbox live or psn: Captain CT108
Re: AI landing in hangars not working
alright script added the main post
- Ascertes
- Private Second Class
- Posts: 65
- Joined: Thu Aug 18, 2016 3:42 pm
- Projects :: Space Carida
- xbox live or psn: No gamertag set
Re: AI landing in hangars not working
Heya! One thing I'm noticing right off the bat is that you have your path listed as "EntityPathLand1"
It should be: "EntityPath Land1"
Secondly, this section:
It should be: (EDIT: For some reason the formatting isn't working correctly for this section. The code is missing all the indents -_-. I hope it's still clear to you in this state!)
I'm assuming Land1 is also the name of the region you want the AI to land in? If so, I'm not sure if the game doesn't like that or not, but I don't see why it wouldn't.
Just as a bit of a third side note, you have DisableSmallMapMiniMap() in your spa8g_ass twice. Hopefully this helps.
It should be: "EntityPath Land1"
Secondly, this section:
- Code: Select all
ActivateRegion("Land1")
Land = OnEnterRegion(
function(region, character)
if GetEntityClass(GetCharacterVehicle(character)) == FindEntityClass("imp_fly_trooptrans") then
print("flyer found :D")
ship = GetCharacterVehicle(character)
EntityFlyerLand(ship)
print("Houston, the Eagle has landed")
end
if not IsCharacerHuman(character) then
ExitVehicle(character)
end
end,
"Land1"
)
It should be: (EDIT: For some reason the formatting isn't working correctly for this section. The code is missing all the indents -_-. I hope it's still clear to you in this state!)
- Code: Select all
ActivateRegion("Land1")
Land = OnEnterRegion(
function(region, character)
if GetEntityClass(GetCharacterVehicle(character)) == FindEntityClass("imp_fly_trooptrans") then
print("flyer found :D")
ship = GetCharacterVehicle(character)
EntityFlyerLand(ship)
SetProperty(ship, "DisableTime", 1e+37)
SetProperty(ship, "DisableTime", 0)
print("Houston, the Eagle has landed")
end
if not IsCharacterHuman(character) then
ExitVehicle(character)
end
end,
"Land1"
)
end
I'm assuming Land1 is also the name of the region you want the AI to land in? If so, I'm not sure if the game doesn't like that or not, but I don't see why it wouldn't.
Just as a bit of a third side note, you have DisableSmallMapMiniMap() in your spa8g_ass twice. Hopefully this helps.
- CT108
-
- Posts: 186
- Joined: Mon Aug 22, 2016 6:20 am
- Location: Dantooine
- Projects :: -Secret-
- Games I'm Playing :: SBF2 - Empire at War
- xbox live or psn: Captain CT108
Re: AI landing in hangars not working
It's not working sorry 
Something I'm wondering, are my path and my landing region in the good layer ? (ass_path)
In the ass_path layer, every paths are in blue excepted mine that is in green. Is it important ?
Is there something to do with a SetMemoryPoolSize ?
Thanks again for the help =)

Something I'm wondering, are my path and my landing region in the good layer ? (ass_path)
In the ass_path layer, every paths are in blue excepted mine that is in green. Is it important ?
Is there something to do with a SetMemoryPoolSize ?
Thanks again for the help =)
- Ascertes
- Private Second Class
- Posts: 65
- Joined: Thu Aug 18, 2016 3:42 pm
- Projects :: Space Carida
- xbox live or psn: No gamertag set
Re: AI landing in hangars not working
So long as those layers are being loaded into the game for your specific era and game mode, you should be fine. I'm not an expert on layers, so maybe someone knows more about this than I do. One thing that may be able to help determine if it is being loaded in: are the AI following the paths at all? Are they just not landing? Information like that could help pin down what the specific issue is.
I also believe paths are blue once you've selected them, and green upon deselection.
As for memory pools, it's not absolutely critical you increase them. The game auto-allocates pools to your map during loading, but if you want it to stop yelling at you to increase them, go ahead.
I also believe paths are blue once you've selected them, and green upon deselection.
As for memory pools, it's not absolutely critical you increase them. The game auto-allocates pools to your map during loading, but if you want it to stop yelling at you to increase them, go ahead.
- Marth8880
- Resistance Leader
-
- Posts: 5229
- Joined: Tue Feb 09, 2010 8:43 pm
- Location: Edinburgh, UK
- Projects :: EVERYWHERE + Zero Munge + TCW
- Games I'm Playing :: The Forest
- xbox live or psn: Marth8880
Re: AI landing in hangars not working
If your flyer path is in a separate layer, did you make sure to press the "Update REQs and MRQs" button after you created the layer? If not, that button can be found in the window that lets you define which layers are loaded in which game modes.
- CT108
-
- Posts: 186
- Joined: Mon Aug 22, 2016 6:20 am
- Location: Dantooine
- Projects :: -Secret-
- Games I'm Playing :: SBF2 - Empire at War
- xbox live or psn: Captain CT108
Re: AI landing in hangars not working
Marth8880 wrote:If your flyer path is in a separate layer, did you make sure to press the "Update REQs and MRQs" button after you created the layer? If not, that button can be found in the window that lets you define which layers are loaded in which game modes.
I'll give it a try thanks =)
btw I didn't created the layer, as I said I'm working on vanilla Space Hoth so all layers are already done. So maybe that "Update REQs and MRQs" is already pressed
Ascertes wrote:So long as those layers are being loaded into the game for your specific era and game mode, you should be fine. I'm not an expert on layers, so maybe someone knows more about this than I do. One thing that may be able to help determine if it is being loaded in: are the AI following the paths at all? Are they just not landing? Information like that could help pin down what the specific issue is.
AI are following the vanilla paths of Hoth (bc I'm working on Space Hoth)
Ascertes wrote:I also believe paths are blue once you've selected them, and green upon deselection.
Nope the path gets yellow when it's selected, but vanilla paths are blue and the one that I created is green, no matter what I do
Ascertes wrote:As for memory pools, it's not absolutely critical you increase them. The game auto-allocates pools to your map during loading, but if you want it to stop yelling at you to increase them, go ahead.
Alright
- Ascertes
- Private Second Class
- Posts: 65
- Joined: Thu Aug 18, 2016 3:42 pm
- Projects :: Space Carida
- xbox live or psn: No gamertag set
Re: AI landing in hangars not working
I'm not entirely sure then what could be causing your problem. Obviously the paths are working because the AI are following the default ones...
I'm really confused here because the stock space hoth LUA defies all conventions that I've come to learn about flyer paths. Is it possible for you to select those blue paths? If so, try to follow what those paths are doing for your own in terms of properties and labels, see if that helps.
Also, assuming you've created the landing region in the enemy hangar, try flying your imp transport into it and see what happens. If the code is working, you shouldn't have to press your land key for the ship to auto-land and everyone get out.
I'm really confused here because the stock space hoth LUA defies all conventions that I've come to learn about flyer paths. Is it possible for you to select those blue paths? If so, try to follow what those paths are doing for your own in terms of properties and labels, see if that helps.
Also, assuming you've created the landing region in the enemy hangar, try flying your imp transport into it and see what happens. If the code is working, you shouldn't have to press your land key for the ship to auto-land and everyone get out.
- Marth8880
- Resistance Leader
-
- Posts: 5229
- Joined: Tue Feb 09, 2010 8:43 pm
- Location: Edinburgh, UK
- Projects :: EVERYWHERE + Zero Munge + TCW
- Games I'm Playing :: The Forest
- xbox live or psn: Marth8880
Re: AI landing in hangars not working
Add a `print` to the beginning of your OnEnterRegion event callback like so:
Then check to see if that message is being printed to the debug log when you enter the region.
- Code: Select all
Land = OnEnterRegion(
function(region, character)
print("spa8g_ass: OnEnterRegion")
Then check to see if that message is being printed to the debug log when you enter the region.
- CT108
-
- Posts: 186
- Joined: Mon Aug 22, 2016 6:20 am
- Location: Dantooine
- Projects :: -Secret-
- Games I'm Playing :: SBF2 - Empire at War
- xbox live or psn: Captain CT108
Re: AI landing in hangars not working
First, sorry for the very late reply. Well when I enter the region with my gunship I don't auto land. I've still not tried what you said Marth, even if I think that the problem comes from my landing region (gotta try what you said soon).
- Ascertes
- Private Second Class
- Posts: 65
- Joined: Thu Aug 18, 2016 3:42 pm
- Projects :: Space Carida
- xbox live or psn: No gamertag set
Re: AI landing in hangars not working
Yeah...I'm totally lost as to what your problem is. If your ship isn't auto-landing in your land region, it means either the region isn't set up correctly or the code isn't working. Given how they're not following the splines either, I'd say it's a result of the latter. I'm not sure WHY it isn't working; your code looks fine to me. I'm going to have to turn this one over completely to Marth.
I hope you get it figured out though. I would definitely need to update my thread on this subject.
I hope you get it figured out though. I would definitely need to update my thread on this subject.
- Marth8880
- Resistance Leader
-
- Posts: 5229
- Joined: Tue Feb 09, 2010 8:43 pm
- Location: Edinburgh, UK
- Projects :: EVERYWHERE + Zero Munge + TCW
- Games I'm Playing :: The Forest
- xbox live or psn: Marth8880
Re: AI landing in hangars not working
He's gonna have to try what I said. :p
13 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests