Comments (4)
I don't remember how I got the list in the first place, but you can take some of this
anno1800-scripting-api/Q/Tools.cpp
Line 309 in 0008307
I do remember that I wanted a more automatic method to fetch the ids, but this might be enough to get you started? :)
Controlling trade routes was actually the latest thing I looked into. I got to a point where I could read route data (stops, goods, ships etc). I never got to the point where I could modify them or make new ones. I'm very interested to hear more if you find out anything!
from anno1800-scripting-api.
I did actually solve my problem! I pulled out the english localization XML and turned it into a python dictionary. I'm very interested in how you read route data as the XML I'm looking at right now is formatted terribly and I can barely navigate it with my XML library since it doesnt follow proper syntax.
from anno1800-scripting-api.
I have an example of a route in the save file below
<None>66</None>
<None>
<ID>66</ID>
<IsDefaultName>01</IsDefaultName>
<Name>Ivy - Mir</Name>
<Ships>
</Ships>
<LostShips />
<Owner>
<id>101</id>
</Owner>
<OwnerType>
<OwnerType>1</OwnerType>
</OwnerType>
<Type>
<id>0000</id>
</Type>
<Stations>
<None>
<StationID>7</StationID>
<AreaID>8710</AreaID>
<GoodInfos />
<Waypoint />
<TradeRouteID>66</TradeRouteID>
<IDManager>
<FreeIDList />
<NextID>2</NextID>
<HotIDList>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
</HotIDList>
</IDManager>
<RouteType />
<RouteOwner>
<id>6500</id>
</RouteOwner>
<AreaOwner>
<id>2000</id>
</AreaOwner>
<HasTradeRights>01</HasTradeRights>
</None>
<None>
<StationID>11</StationID>
<AreaID>8966</AreaID>
<GoodInfos />
<Waypoint />
<TradeRouteID>66</TradeRouteID>
<IDManager>
<FreeIDList />
<NextID>2</NextID>
<HotIDList>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
</HotIDList>
</IDManager>
<RouteType />
<RouteOwner>
<id>6500</id>
</RouteOwner>
<AreaOwner>
<id>2000</id>
</AreaOwner>
<HasTradeRights>01</HasTradeRights>
</None>
<None>
<StationID>4</StationID>
<AreaID>9158</AreaID>
<GoodInfos />
<Waypoint />
<TradeRouteID>66</TradeRouteID>
<IDManager>
<FreeIDList />
<NextID>2</NextID>
<HotIDList>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
</HotIDList>
</IDManager>
<RouteType />
<RouteOwner>
<id>6500</id>
</RouteOwner>
<AreaOwner>
<id>2000</id>
</AreaOwner>
<HasTradeRights>01</HasTradeRights>
</None>
<None>
<StationID>3</StationID>
<AreaID>8838</AreaID>
<GoodInfos />
<Waypoint />
<TradeRouteID>66</TradeRouteID>
<IDManager>
<FreeIDList />
<NextID>2</NextID>
<HotIDList>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
</HotIDList>
</IDManager>
<RouteType />
<RouteOwner>
<id>6500</id>
</RouteOwner>
<AreaOwner>
<id>2000</id>
</AreaOwner>
<HasTradeRights>01</HasTradeRights>
</None>
<None>
<StationID>12</StationID>
<AreaID>9286</AreaID>
<GoodInfos />
<Waypoint />
<TradeRouteID>66</TradeRouteID>
<IDManager>
<FreeIDList />
<NextID>2</NextID>
<HotIDList>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
</HotIDList>
</IDManager>
<RouteType />
<RouteOwner>
<id>6500</id>
</RouteOwner>
<AreaOwner>
<id>2000</id>
</AreaOwner>
<HasTradeRights>01</HasTradeRights>
</None>
<None>
<StationID>9</StationID>
<AreaID>8902</AreaID>
<GoodInfos />
<Waypoint />
<TradeRouteID>66</TradeRouteID>
<IDManager>
<FreeIDList />
<NextID>2</NextID>
<HotIDList>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
</HotIDList>
</IDManager>
<RouteType />
<RouteOwner>
<id>6500</id>
</RouteOwner>
<AreaOwner>
<id>2000</id>
</AreaOwner>
<HasTradeRights>01</HasTradeRights>
</None>
<None>
<StationID>10</StationID>
<AreaID>9094</AreaID>
<GoodInfos />
<Waypoint />
<TradeRouteID>66</TradeRouteID>
<IDManager>
<FreeIDList />
<NextID>2</NextID>
<HotIDList>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
</HotIDList>
</IDManager>
<RouteType />
<RouteOwner>
<id>6500</id>
</RouteOwner>
<AreaOwner>
<id>2000</id>
</AreaOwner>
<HasTradeRights>01</HasTradeRights>
</None>
<None>
<StationID>5</StationID>
<AreaID>8646</AreaID>
<GoodInfos />
<Waypoint />
<TradeRouteID>66</TradeRouteID>
<IDManager>
<FreeIDList />
<NextID>2</NextID>
<HotIDList>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
</HotIDList>
</IDManager>
<RouteType />
<RouteOwner>
<id>6500</id>
</RouteOwner>
<AreaOwner>
<id>2000</id>
</AreaOwner>
<HasTradeRights>01</HasTradeRights>
</None>
<None>
<StationID>8</StationID>
<AreaID>9030</AreaID>
<GoodInfos />
<Waypoint />
<TradeRouteID>66</TradeRouteID>
<IDManager>
<FreeIDList />
<NextID>2</NextID>
<HotIDList>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
</HotIDList>
</IDManager>
<RouteType />
<RouteOwner>
<id>6500</id>
</RouteOwner>
<AreaOwner>
<id>2000</id>
</AreaOwner>
<HasTradeRights>01</HasTradeRights>
</None>
<None>
<StationID>6</StationID>
<AreaID>8774</AreaID>
<GoodInfos />
<Waypoint />
<TradeRouteID>66</TradeRouteID>
<IDManager>
<FreeIDList />
<NextID>2</NextID>
<HotIDList>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
</HotIDList>
</IDManager>
<RouteType />
<RouteOwner>
<id>6500</id>
</RouteOwner>
<AreaOwner>
<id>2000</id>
</AreaOwner>
<HasTradeRights>01</HasTradeRights>
</None>
<None>
<StationID>2</StationID>
<AreaID>8326</AreaID>
<GoodInfos />
<Waypoint />
<TradeRouteID>66</TradeRouteID>
<IDManager>
<FreeIDList />
<NextID>2</NextID>
<HotIDList>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
</HotIDList>
</IDManager>
<RouteType />
<RouteOwner>
<id>6500</id>
</RouteOwner>
<AreaOwner>
<id>6500</id>
</AreaOwner>
<HasTradeRights>01</HasTradeRights>
</None>
<None>
<StationID>13</StationID>
<AreaID>9222</AreaID>
<GoodInfos />
<Waypoint />
<TradeRouteID>66</TradeRouteID>
<IDManager>
<FreeIDList />
<NextID>2</NextID>
<HotIDList>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
</HotIDList>
</IDManager>
<RouteType />
<RouteOwner>
<id>6500</id>
</RouteOwner>
<AreaOwner>
<id>2000</id>
</AreaOwner>
<HasTradeRights>01</HasTradeRights>
</None>
</Stations>
<IDManager>
<FreeIDList />
<NextID>14</NextID>
<HotIDList>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
<None>
</None>
</HotIDList>
</IDManager>
<LastErrors>30303030303030303030303030303030</LastEr
<CharterRouteDescription>
<SourceArea>0000</SourceArea>
<TargetArea>0000</TargetArea>
</CharterRouteDescription>
</None>
from anno1800-scripting-api.
I did not konw that savegames were saved as XML. That is quite nice! Thank you for sharing :D
from anno1800-scripting-api.
Related Issues (9)
- API doesn't seem to find all islands or can't determine their name
- What does the .exe file in releases do? HOT 1
- Impossible to use for someone not versed in the code HOT 7
- Cannot get monocle to run HOT 6
- API Insights HOT 1
- Stand alone version HOT 2
- The program gets stuck at acceptedSocket.Wait(); (Telegraph.gen.cs#L63) and blockages related to the game update HOT 6
- Crash with telegraph.GetPlayerIslandsInWorld(areas[0], out islands); HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anno1800-scripting-api.