3 Campaign Questions
Moderator: Moderators
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
3 Campaign Questions
I have three questions, all of which I am sure have easy answers, but unfortunately I don't know the answers.
1. You know that yellow arrow that appears over objectives? What's the code to get rid of it, and where do you put it?
2. What's the code to spawn AI after an objective is completed, and where do you put that?
3. Er, well, there was a third question, but it just floated out of my head. I'll try and remember it.
That's all, and I'm sure there are straightforward answers to them. Thanks for the help!
And Happy New Year!
1. You know that yellow arrow that appears over objectives? What's the code to get rid of it, and where do you put it?
2. What's the code to spawn AI after an objective is completed, and where do you put that?
3. Er, well, there was a third question, but it just floated out of my head. I'll try and remember it.
That's all, and I'm sure there are straightforward answers to them. Thanks for the help!
And Happy New Year!
-
Commander_Fett
- High General

- Posts: 847
- Joined: Fri Oct 17, 2008 9:59 pm
- Projects :: No Mod project currently.
Re: 3 Campaign Questions
find this in your LUA:
change it to whatever you want.
Code: Select all
AllowAISpawn(ATT, false)
AllowAISpawn(DEF, true)- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: 3 Campaign Questions
Won't that make them spawn from the beginning? I want to appear only after a certain objective is completed, and I don't see that line anywhere in the objective's code.
-
fiddler_on_the_roof
- 1st Lieutenant

- Posts: 460
- Joined: Wed Nov 12, 2008 5:28 pm
- Projects :: No Mod project currently.
- xbox live or psn: No gamertag set
Re: 3 Campaign Questions
Question 1-- look for this line
If you delete it, I think the arrow should go away.
Code: Select all
MapAddEntityMarker("cp6", "hud_objective_icon", 3.0, 1, "YELLOW", true)- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: 3 Campaign Questions
That does sound like it could work, but the problem is that my LUA doesn't have that line in the first place.
Here it is, more or less:
Here it is, more or less:
Hidden/Spoiler:
- bobfinkl
- Rebel Colonel

- Posts: 593
- Joined: Sun Jul 13, 2008 9:01 am
- Projects :: Lots of unreleased stuff
- xbox live or psn: No gamertag set
- Location: The quaint little city gametoast.
Re: 3 Campaign Questions
1. Campaign scripts auto detect regions so you have to edit that line, I can't remember the exact code but it has nil in there somewhere.
2. Commander Fett is right that code is correct, DEF and ATT define which team can have spawning or non spawning AI, False and True are self explanatory, and you would place the "false" line on the objective where you want the AI to stop spawning and the "true" line on the objective you want the AI to start spawning (note if you put the "false" line above the objectives where you place all the other level specifications you can prevent AI spawning for the duration of the mission until it reaches a "true" line)
2. Commander Fett is right that code is correct, DEF and ATT define which team can have spawning or non spawning AI, False and True are self explanatory, and you would place the "false" line on the objective where you want the AI to stop spawning and the "true" line on the objective you want the AI to start spawning (note if you put the "false" line above the objectives where you place all the other level specifications you can prevent AI spawning for the duration of the mission until it reaches a "true" line)
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: 3 Campaign Questions
Hmmmm....I tried that now, and it still doesn't work. The CIS spawns instantly, while the Republic doesn't spawn at all.
Did I put the lines in the wrong places?
EDIT - I remembered the third question! When you create a region for a "goto" stlye objective, which layer do you have to put it in and what shape does it have to be?
Hidden/Spoiler:
EDIT - I remembered the third question! When you create a region for a "goto" stlye objective, which layer do you have to put it in and what shape does it have to be?
- ThePanda
- Private Second Class
- Posts: 74
- Joined: Sat Dec 20, 2008 4:22 pm
Re: 3 Campaign Questions
I think you can just put the "goto" region in the same layer as you put all of your other campaign stuff. And I'm not sure on the specific shape the region has to be, but the box shape works fine.
I think this may be your AI problem:
If you move the line highlighted in blue before the 'end', I think it may work:
I'm not 100%, but that looks like how the CIS is managing to spawn.
I think this may be your AI problem:
Hidden/Spoiler:
Hidden/Spoiler:
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: 3 Campaign Questions
Thanks. Question 2 can be marked as answered. But question 1 can't. Does anyone know the code for that?
- DarthD.U.C.K.
- Master of the Force

- Posts: 6027
- Joined: Wed Sep 27, 2006 11:05 am
- Location: Duckburg, Germany
Re: 3 Campaign Questions
i think those markerlines define how and if the object or whatever is marked
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: 3 Campaign Questions
What marker lines? I searched the LUA for "marker" and nothing came up.
- ThePanda
- Private Second Class
- Posts: 74
- Joined: Sat Dec 20, 2008 4:22 pm
Re: 3 Campaign Questions
I'm not sure if you can get rid of the marker. I think it's linked to the objective, meaning it's linked to the CP you're supposed to capture, or the objects you're supposed to kill. It automatically gets displayed above them.
I could be wrong though.
I could be wrong though.
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: 3 Campaign Questions
I know there's an admin command that can make the arrow appear over your head, and also make it go away. I thought this would be similar. Is it?
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: 3 Campaign Questions
It is, and it's already been mentioned in this thread.Fiodis wrote:I know there's an admin command that can make the arrow appear over your head, and also make it go away. I thought this would be similar. Is it?
To which you responded:fiddler_on_the_roof wrote:Question 1-- look for this lineIf you delete it, I think the arrow should go away.Code: Select all
MapAddEntityMarker("cp6", "hud_objective_icon", 3.0, 1, "YELLOW", true)
And this is why I've told anyone that starts off scripting with the mission scripting tool that they should learn basic lua events first, because what you've done is gone and added code that you don't understand. Problems like this will continue to pop up if you keep using the predefined campaign lua events (like ObjectiveConquest) and if you don't take the time to look through them.Fiodis wrote:That does sound like it could work, but the problem is that my LUA doesn't have that line in the first place.
Here it is, more or less:Hidden/Spoiler:
The earlier post was on the right track - those markers are added by MapAddEntityMarker (or MapAddRegionMarker, etc.), but you don't see them because they're part of ObjectiveConquest. Use MapRemoveEntityMarker to take it away.
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: 3 Campaign Questions
Well, I've looked through Teancum's long list of functions, and I found two that I would need, MapRemoveEntityMarker and MapRemoveRegionMarker. Now, I have just three questions (again) to wrap this whole arrow issue up. Where in your LUA do you put these functions? Do you place them right after you define the cp's and scriptpostload? Or do you place them in a certain objective?
fiddler_on_the_roof gave me a line to delete, MapAddEntityMarker("cp6", "hud_objective_icon", 3.0, 1, "YELLOW", true). I notce that it's a function with more added to the end. I assume that this "more" is what the function....functions on. What "more" would I put after MapRemoveEntityMarker and MapRemoveRegionMarker?
Let my try:
MapRemoveEntityMarker("cp2", "hud_objective_icon", 3.0, 1, "YELLOW", true)
to get it off cp2 and
MapRemoveRegionMarker("region01", "hud_objective_icon", 3.0, 1, "YELLOW", true)
to get it off region region01. Am I right?
Also, the third question: in my attempts to solve this problem using skinning instead of scripting, I found a set of four .tga's in dataCPT/Common/interface that were called hud_objective_icon, hud_objective_icon_offscreen, hud_objective_icon_hidden, and hud_objective_icon_circle. Now I noticed
MapRemoveEntityMarker("cp2", "hud_objective_icon", 3.0, 1, "YELLOW", true)
Do I have to add a separate MapRemoveEntityMarker for each of the four tga's?
fiddler_on_the_roof gave me a line to delete, MapAddEntityMarker("cp6", "hud_objective_icon", 3.0, 1, "YELLOW", true). I notce that it's a function with more added to the end. I assume that this "more" is what the function....functions on. What "more" would I put after MapRemoveEntityMarker and MapRemoveRegionMarker?
Let my try:
MapRemoveEntityMarker("cp2", "hud_objective_icon", 3.0, 1, "YELLOW", true)
to get it off cp2 and
MapRemoveRegionMarker("region01", "hud_objective_icon", 3.0, 1, "YELLOW", true)
to get it off region region01. Am I right?
Also, the third question: in my attempts to solve this problem using skinning instead of scripting, I found a set of four .tga's in dataCPT/Common/interface that were called hud_objective_icon, hud_objective_icon_offscreen, hud_objective_icon_hidden, and hud_objective_icon_circle. Now I noticed
MapRemoveEntityMarker("cp2", "hud_objective_icon", 3.0, 1, "YELLOW", true)
Do I have to add a separate MapRemoveEntityMarker for each of the four tga's?
- Maveritchell
- Jedi Admin

- Posts: 7366
- Joined: Mon Aug 21, 2006 11:03 pm
Re: 3 Campaign Questions
No, you shouldn't have to do more than one, and you should also only do:
instead of:
That other stuff is pertinent for adding the marker, but when removing it, it is irrelevant.
Code: Select all
MapRemoveEntityMarker("cp2", "hud_objective_icon") Code: Select all
MapRemoveEntityMarker("cp2", "hud_objective_icon", 3.0, 1, "YELLOW", true) - Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: 3 Campaign Questions
Ok, I understood that all. The only problem left for adding the MapRemoveEntityMarker and MapRemoveRegionMarker is where to put them. I was very unsure, because I thought that if I add the line before it's needed, it won't remove the marker; but if I add it after, it will remove it after the marker has alreay been displayed.
Here's my final decision regarding its location. I tried to put it in the objective that I want to have no marker.
I suppose that adding it in the middle of the thing like that was a bad move, because the campaign refused to start and the AI refused to spawn. Still, I'm surprised I avoided a CTD, after I looked at the error log:
I don't even know what "depricated" means, let alone why I must delete ShowPopup(). And how can the timers not be found if they were working prior to me adding MapRemoveEntityMarker?
I assume "bad argument #2 to `MapRemoveEntityMarker' (number expected, got string)" means that where there should be a number, there was a few letters. Is that referring to the "cp2" in MapRemoveEntityMarker("cp2", "hud_objective_icon")? If so, I ought to replace it with just "2", right? But then won't the LUA ask "2 what?"? And if the string means hud_objective_icon, how would it know to remove the arrow if I replace it with a number?
Here's my final decision regarding its location. I tried to put it in the objective that I want to have no marker.
Hidden/Spoiler:
Hidden/Spoiler:
I assume "bad argument #2 to `MapRemoveEntityMarker' (number expected, got string)" means that where there should be a number, there was a few letters. Is that referring to the "cp2" in MapRemoveEntityMarker("cp2", "hud_objective_icon")? If so, I ought to replace it with just "2", right? But then won't the LUA ask "2 what?"? And if the string means hud_objective_icon, how would it know to remove the arrow if I replace it with a number?
-
RepSharpshooter
- Gametoast Staff

- Posts: 1351
- Joined: Tue Jul 10, 2007 4:10 pm
Re: 3 Campaign Questions
deprecated means no longer used, and is usually replaced by something else. (lol pandemic spelled it wrong).
I think maybe it should go like this:
You can't remove a marker before you create it.
I think maybe it should go like this:
Code: Select all
Objective1CP = CommandPost:New{name = "cp2"}
Objective1 = ObjectiveConquest:New{teamATT = ATT, teamDEF = DEF, text = "b", popupText = "b", AIGoalWeight = 0}
Objective1:AddCommandPost(Objective1CP)
MapRemoveEntityMarker("cp2", "hud_objective_icon")
- Fiodis
- Master of the Force

- Posts: 4145
- Joined: Wed Nov 12, 2008 9:27 pm
- Projects :: Rannoch + Tientia + Tools Programming
Re: 3 Campaign Questions
I tried that, but got pretty much the same error.
Also, why aren't the timers being found? And what's a ditty?
Hidden/Spoiler:
Also, why aren't the timers being found? And what's a ditty?
-
RepSharpshooter
- Gametoast Staff

- Posts: 1351
- Joined: Tue Jul 10, 2007 4:10 pm
Re: 3 Campaign Questions
try
Without the second argument.
Code: Select all
MapRemoveEntityMarker("cp2")