|
Post by panzer333 on Oct 15, 2014 10:51:43 GMT 1
Hi guys,
I have made a map for HRA 1.1, I had it working but the script was in need of some work. I also found a few errors which I corrected. Obviously i made a mistake somewhere and it's not worked since. I asked Quintaxel for help and he has been a star with all he's tried to do for me! But it still crashes right on the 1st trigger, and I'm pulling my hair out because I can find nothing wrong.
Well I just wondered if anybody else would be prepared to help out?, a fresh perspective just might help.
should i post the link here? or pm me if you prefer.
Thanks in advance,
Panzer333
|
|
|
Post by ariete on Oct 15, 2014 12:15:23 GMT 1
copy and paste here the whole text
|
|
|
Post by panzer333 on Oct 15, 2014 12:47:14 GMT 1
I assume you want the Lua, function Init() DisplayTrace("Auto-generated script"); RunScript("ToLose", 5000); RunScript("StartObjective0", 5000); end; function StartObjective0() ObjectiveChanged(0,0); RunScript("CheckObjective0", 5000); Suicide(); end; function CheckObjective0() if GetNUnitsInArea(0,"russ1") > 0 then ObjectiveChanged(0, 1); LandReinforcement(1000); RunScript("StartObjective1", 5000); Suicide(); end; end; function StartObjective1() ObjectiveChanged(1,0); RunScript("CheckObjective1", 5000); Suicide(); end; function CheckObjective1() if GetNUnitsInArea(0,"ger1") > 0 then ObjectiveChanged(1, 1); LandReinforcement(2003); RunScript("StartObjective2", 5000); Suicide(); end; end; function StartObjective2() ObjectiveChanged(2,0); RunScript("CheckObjective2", 5000); Suicide(); end; function CheckObjective2() if GetNUnitsInArea(1, "wood") < 1 then ObjectiveChanged(2, 1); LandReinforcement(2002); RunScript("StartObjective3", 5000); Suicide(); end; end; function StartObjective3() ObjectiveChanged(3,0); RunScript("CheckObjective3", 5000); Suicide(); end; function CheckObjective3() if GetNUnitsInArea(1, "bridge") < 1 then ObjectiveChanged(3, 1); LandReinforcement(2005); RunScript("StartObjective4", 5000); Suicide(); end; end; function StartObjective4() ObjectiveChanged(4,0); RunScript("CheckObjective4", 5000); Suicide(); end; function CheckObjective4() if GetNUnitsInArea(0,"tanks") > 0 then ObjectiveChanged(4, 1); LandReinforcement(1004); RunScript("StartObjective5", 5000); Suicide(); end; end; function StartObjective5() ObjectiveChanged(5,0); RunScript("CheckObjective5", 5000); Suicide(); end; function CheckObjective5() if GetNUnitsInScriptGroup(1004) < 1 then ObjectiveChanged(5, 1); LandReinforcement(1006); RunScript("StartObjective6", 5000); Suicide(); end; end; function StartObjective6() ObjectiveChanged(6,0); RunScript("CheckObjective6", 5000); Suicide(); end; function CheckObjective6() if GetNUnitsInScriptGroup(1006) < 1 then ObjectiveChanged(6, 1); DisplayTrace("You Win"); RunScript("ToWin", 2000); Suicide(); end; end; function ToWin() Win(0); end; function ToLose() if GetNUnitsInParty(0) == 0 then Loose(0); Suicide(); end; end; Thank you panzer333
|
|
|
Post by feldgrau on Oct 15, 2014 14:13:53 GMT 1
Hi panzer333
those ( ) with purely, might help in some cases
function Init() DisplayTrace("Auto-generated script"); RunScript("ToLose", 5000); RunScript("StartObjective0", 5000); end;
function StartObjective0() ObjectiveChanged(0,0); RunScript("CheckObjective0", 5000); Suicide(); end;
function CheckObjective0() if ( GetNUnitsInArea(0,"russ1") > 0 ) then ObjectiveChanged(0, 1); LandReinforcement(1000); RunScript("StartObjective1", 5000); Suicide(); end; end;
function StartObjective1() ObjectiveChanged(1,0); RunScript("CheckObjective1", 5000); Suicide(); end;
function CheckObjective1() if ( GetNUnitsInArea(0,"ger1") > 0 ) then ObjectiveChanged(1, 1); LandReinforcement(2003); RunScript("StartObjective2", 5000); Suicide(); end; end;
function StartObjective2() ObjectiveChanged(2,0); RunScript("CheckObjective2", 5000); Suicide(); end;
function CheckObjective2() if ( GetNUnitsInArea(1, "wood") < 1 ) then ObjectiveChanged(2, 1); LandReinforcement(2002); RunScript("StartObjective3", 5000); Suicide(); end; end;
function StartObjective3() ObjectiveChanged(3,0); RunScript("CheckObjective3", 5000); Suicide(); end;
function CheckObjective3() if ( GetNUnitsInArea(1, "bridge") < 1 ) then ObjectiveChanged(3, 1); LandReinforcement(2005); RunScript("StartObjective4", 5000); Suicide(); end; end;
function StartObjective4() ObjectiveChanged(4,0); RunScript("CheckObjective4", 5000); Suicide(); end;
function CheckObjective4() if ( GetNUnitsInArea(0,"tanks") > 0 ) then ObjectiveChanged(4, 1); LandReinforcement(1004); RunScript("StartObjective5", 5000); Suicide(); end; end;
function StartObjective5() ObjectiveChanged(5,0); RunScript("CheckObjective5", 5000); Suicide(); end;
function CheckObjective5() if ( GetNUnitsInScriptGroup(1004) < 1 ) then ObjectiveChanged(5, 1); LandReinforcement(1006); RunScript("StartObjective6", 5000); Suicide(); end; end;
function StartObjective6() ObjectiveChanged(6,0); RunScript("CheckObjective6", 5000); Suicide(); end;
function CheckObjective6() if ( GetNUnitsInScriptGroup(1006) < 1 ) then ObjectiveChanged(6, 1); DisplayTrace("You Win"); RunScript("ToWin", 2000); Suicide(); end; end;
function ToWin() Win(0); end;
function ToLose() if ( GetNUnitsInParty(0) == 0 ) then Loose(0); Suicide(); end; end;
mbkg Feldgrau
|
|
|
Post by panzer333 on Oct 15, 2014 19:06:17 GMT 1
Hi feldgrau,
I tried out your suggestion and the objective markers now show in game which they didn't before. However it still crashed on the 1st trigger. I have had another idea I can try, I'll let you know what happens.
Thanks for your help,
panzer333
|
|
|
Post by feldgrau on Oct 15, 2014 20:03:13 GMT 1
Hi...
Have you already done the "your mission" Folder (data/scenarios/custom/missions/your_mission)? Perhaps with the files from the "your mission" folder (1.xml) anything not properly.
mbkg Feldgrau
|
|
|
Post by panzer333 on Oct 15, 2014 21:47:56 GMT 1
yeah thats the same address as my folder.
The 1.xml I'm not sure about. I used a 1.xml from another map and changed it to my needs, it did work, but the objective markers wouldn't appear. I changed it a few times working things out, So I could have messed it up. I will go through the tutorial again and check.
Sorry this is very new to me.
Thanks Feldgrau.
|
|
|
Post by feldgrau on Oct 16, 2014 7:06:46 GMT 1
Hi...
I suspect from "<Objectives>" does not match anything.
<Objectives> <item AnchorScriptID="-1" Secret="0"> <Header>scenarios\custom\missions\your_mission\0h</Header> <DescriptionText>scenarios\custom\missions\your_mission\0</DescriptionText> <PosOnMap y="480" x="263"/> </item> ... ... </Objectives>
mbkg Feldgrau
|
|
|
Post by panzer333 on Oct 16, 2014 8:45:23 GMT 1
<?xml version="1.0"?> <!-- deleted comment here --> <base> <History> <CurrentOwner>Panzer333</CurrentOwner> </History> <RPG> <KeyName/> <StatsType>Mission</StatsType> <HeaderText>Scenarios\Custom\Missions\attack\header</HeaderText> <SubheaderText>Scenarios\Custom\Missions\attack\subheader</SubheaderText> <DescriptionText>Scenarios\Custom\Missions\attack\description</DescriptionText> <MapImage>Scenarios\Custom\Missions\attack\map</MapImage> <MapImageRect x1="0" y1="0" x2="0" y2="0"/> <TemplateMap></TemplateMap> <FinalMap>attack</FinalMap> <CombatMusics> <item>music\combat1</item> <item>music\combat2</item> <item>music\combat3</item> <item>music\combat4</item> <item>music\combat5</item> <item>music\combat6</item> <item>music\combat7</item> <item>music\brief_german</item> <item>music\brief_russian</item> </CombatMusics> <ExplorMusics> <item>music\explore1</item> <item>music\explore2</item> <item>music\explore3</item> <item>music\explore4</item> <item>music\explore5</item> <item>music\explore6</item> <item>music\explore_german</item> <item>music\explore_russian</item> </ExplorMusics> <Objectives> <item Secret="1" AnchorScriptID="-1"> <Header>Scenarios\Custom\Missions\attack\0h</Header> <DescriptionText>Scenarios\Custom\Missions\attack\0</DescriptionText> <PosOnMap x="239" y="295"/> </item> <item Secret="1" AnchorScriptID="-1"> <Header>Scenarios\Custom\Missions\attack\1h</Header> <DescriptionText>Scenarios\Custom\Missions\attack\1</DescriptionText> <PosOnMap x="427" y="246"/> </item> </Objectives> <SettingName></SettingName> <MODName>HRA</MODName> <MODVersion>1.1</MODVersion> </RPG> </base>
To my untrained eyes it looks ok.
|
|
tedi88
General
Blitzkrieg State Prosecutor
Posts: 1,228
|
Post by tedi88 on Oct 16, 2014 14:24:52 GMT 1
You also have 7 objectives in the script but only two are mentioned in xml. That could be the reason why objective arrows haven't appeared.
|
|
|
Post by feldgrau on Oct 16, 2014 16:15:42 GMT 1
You also have 7 objectives in the script but only two are mentioned in xml. That could be the reason why objective arrows haven't appeared. Hi tedi88 & Panzer3
That could be. But actually it is in the mission "attack" only after termination of objective1 not continue. If the advice of tedi88 nothing improves then send me the mission files.
mbkg Feldgrau
|
|
|
Post by panzer333 on Oct 16, 2014 22:44:56 GMT 1
Hi guys,
I made quite a few changes to the map last night. I deleted each objective until the map worked. Unfortunately I posted the new 1.xml....yes I feel like a complete buffoon now lol.
Here is the origanal....
<?xml version='1.0'?> <base><History><PreviousPath></PreviousPath><PreviousDate>17.09.14</PreviousDate><PreviousTime>10:15:04</PreviousTime><PreviousOwner>panzer333</PreviousOwner><Action>Exported as</Action><CurrentPath>\scenarios\custom\missions\attack\1.xml</CurrentPath><CurrentDate>17.09.14</CurrentDate><CurrentTime>10:15:04</CurrentTime><CurrentOwner>panzer333</CurrentOwner></History><RPG><KeyName></KeyName><StatsType>Mission</StatsType><HeaderText>\scenarios\custom\missions\attack\header</HeaderText><SubheaderText>\scenarios\custom\missions\attack\sheader</SubheaderText><DescriptionText>\scenarios\custom\missions\attack\description</DescriptionText><MapImage></MapImage><MapImageRect x1='512' y1='512' x2='1.00089' y2='1.00089'/><TemplateMap></TemplateMap><FinalMap>attack</FinalMap><CombatMusics><item>music\combat1</item><item>music\combat2</item><item>music\combat3</item></CombatMusics><ExplorMusics><item>music\explore1</item><item>music\explore2</item><item>music\explore3</item><item>music\explore4</item></ExplorMusics><Objectives><item Secret='0' AnchorScriptID='-1'><Header>\scenarios\custom\missions\attack\0h</Header><DescriptionText>\scenarios\custom\missions\attack\0</DescriptionText><PosOnMap x='255' y='308'/></item><item Secret='1' AnchorScriptID='-1'><Header>\scenarios\custom\missions\attack\1h</Header><DescriptionText>\scenarios\custom\missions\attack\1</DescriptionText><PosOnMap x='227' y='211'/></item><item Secret='2' AnchorScriptID='-1'><Header>\scenarios\custom\missions\attack\2h</Header><DescriptionText>\scenarios\custom\missions\attack\2</DescriptionText><PosOnMap x='230' y='242'/></item><item Secret='3' AnchorScriptID='-1'><Header>\scenarios\custom\missions\attack\3h</Header><DescriptionText>\scenarios\custom\missions\attack\3</DescriptionText><PosOnMap x='410' y='252'/></item><item Secret='4' AnchorScriptID='-1'><Header>\scenarios\custom\missions\attack\4h</Header><DescriptionText>\scenarios\custom\missions\attack\4</DescriptionText><PosOnMap x='482' y='186'/></item><item Secret='5' AnchorScriptID='-1'><Header>\scenarios\custom\missions\attack\5h</Header><DescriptionText>\scenarios\custom\missions\attack\5</DescriptionText><PosOnMap x='457' y='14'/></item></Objectives><SettingName></SettingName><MODName>HRA</MODName><MODVersion>1.1</MODVersion></RPG></base>
feldgrau, Please check your pm
Thanks for looking guys.
panzer333
|
|
tedi88
General
Blitzkrieg State Prosecutor
Posts: 1,228
|
Post by tedi88 on Oct 16, 2014 23:00:50 GMT 1
Hi guys, I made quite a few changes to the map last night. I deleted each objective until the map worked. Unfortunately I posted the new 1.xml....yes I feel like a complete buffoon now lol. Here is the origanal.... <?xml version='1.0'?> <base><History><PreviousPath></PreviousPath><PreviousDate>17.09.14</PreviousDate><PreviousTime>10:15:04</PreviousTime><PreviousOwner>panzer333</PreviousOwner><Action>Exported as</Action><CurrentPath>\scenarios\custom\missions\attack\1.xml</CurrentPath><CurrentDate>17.09.14</CurrentDate><CurrentTime>10:15:04</CurrentTime><CurrentOwner>panzer333</CurrentOwner></History><RPG><KeyName></KeyName><StatsType>Mission</StatsType><HeaderText>\scenarios\custom\missions\attack\header</HeaderText><SubheaderText>\scenarios\custom\missions\attack\sheader</SubheaderText><DescriptionText>\scenarios\custom\missions\attack\description</DescriptionText><MapImage></MapImage><MapImageRect x1='512' y1='512' x2='1.00089' y2='1.00089'/><TemplateMap></TemplateMap><FinalMap>attack</FinalMap><CombatMusics><item>music\combat1</item><item>music\combat2</item><item>music\combat3</item></CombatMusics><ExplorMusics><item>music\explore1</item><item>music\explore2</item><item>music\explore3</item><item>music\explore4</item></ExplorMusics><Objectives><item Secret='0' AnchorScriptID='-1'><Header>\scenarios\custom\missions\attack\0h</Header><DescriptionText>\scenarios\custom\missions\attack\0</DescriptionText><PosOnMap x='255' y='308'/></item><item Secret='1' AnchorScriptID='-1'><Header>\scenarios\custom\missions\attack\1h</Header><DescriptionText>\scenarios\custom\missions\attack\1</DescriptionText><PosOnMap x='227' y='211'/></item><item Secret='2' AnchorScriptID='-1'><Header>\scenarios\custom\missions\attack\2h</Header><DescriptionText>\scenarios\custom\missions\attack\2</DescriptionText><PosOnMap x='230' y='242'/></item><item Secret='3' AnchorScriptID='-1'><Header>\scenarios\custom\missions\attack\3h</Header><DescriptionText>\scenarios\custom\missions\attack\3</DescriptionText><PosOnMap x='410' y='252'/></item><item Secret='4' AnchorScriptID='-1'><Header>\scenarios\custom\missions\attack\4h</Header><DescriptionText>\scenarios\custom\missions\attack\4</DescriptionText><PosOnMap x='482' y='186'/></item><item Secret='5' AnchorScriptID='-1'><Header>\scenarios\custom\missions\attack\5h</Header><DescriptionText>\scenarios\custom\missions\attack\5</DescriptionText><PosOnMap x='457' y='14'/></item></Objectives><SettingName></SettingName><MODName>HRA</MODName><MODVersion>1.1</MODVersion></RPG></base> feldgrau, Please check your pm Thanks for looking guys. panzer333 You still don't have the seven objectives marked in xml. Unless it's a typo? You're not a buffon.
|
|
|
Post by panzer333 on Oct 16, 2014 23:26:18 GMT 1
I think this is part of the problem, there was never 7 objectives. I had 3 objectives and 4 triggers on the map, I made the Lua in the "Lua script builder" which makes the triggers into objectives. As they where not ojectives to me and I didn't want to reveal them to the player, I didn't see the need to mark them on the map or put them in the 1.xml.
So are they triggers or objectives, I'm really not sure?
panzer333
|
|
tedi88
General
Blitzkrieg State Prosecutor
Posts: 1,228
|
Post by tedi88 on Oct 16, 2014 23:31:25 GMT 1
I think this is part of the problem, there was never 7 objectives. I had 3 objectives and 4 triggers on the map, I made the Lua in the "Lua script builder" which makes the triggers into objectives. As they where not ojectives to me and I didn't want to reveal them to the player, I didn't see the need to mark them on the map or put them in the 1.xml. So are they triggers or objectives, I'm really not sure? panzer333 Well in a script they have the part that marks them as objectives. Namely these parts are (for the example): ObjectiveChanged(3,0); ObjectiveChanged(3, 1); Simply removing them will stop them from being marked as an objectives. On the other hand if you want to have 3 objectives - then the initial xml you posted lacks one objective entry.
|
|