Search found 48 matches
- Sat Apr 24, 2021 12:49 pm
- Forum: Panzer Corps 2 Scenario Design
- Topic: Lua modules
- Replies: 11
- Views: 6110
Re: Lua modules
After moving the copied & pasted duplicates into a common shared.lua library (and more clean up): The attached file contains the revised Lua scripts used in the above comparison. The additional comments inflated the counts slightly. :roll: Note that the shared.lua library module is duplicated i...
- Sat Apr 24, 2021 12:36 pm
- Forum: Panzer Corps 2 Scenario Design
- Topic: Lua modules
- Replies: 11
- Views: 6110
Re: Lua modules
As a baseline, here are the .lua files after slight clean-up and commenting: . Original files in attached .zip file. Line and word counts as reported by wc -l -w (not a perfect SLOC count, but close enough) for the original (commented and slightly cleaned up) AO* .lua files: 18,229 82,170 After mov...
- Sat Apr 24, 2021 12:25 pm
- Forum: Panzer Corps 2 Scenario Design
- Topic: Lua modules
- Replies: 11
- Views: 6110
Re: Lua modules
The single, shared definitions of functions IsItemInTable() , AddEquipment() , &c can be moved to the library file shared.lua . One very important caveat: Due to a defect in the UE4 Lua plugin, re-loading does not re-load require d .lua files. As a work-around, the library module needs to: set ...
- Sun Apr 18, 2021 12:31 am
- Forum: Panzer Corps 2 Scenario Design
- Topic: Lua modules
- Replies: 11
- Views: 6110
Re: Lua modules
As a baseline, here are the .lua files after slight clean-up and commenting: Lines Words File 40 146 AO0Spain/script.lua 365 1852 AO0Spain/01Seville/Seville.lua 418 2001 AO0Spain/02Antequera/Antequera.lua 225 948 AO0Spain/03Merida/Merida.lua 104 360 AO0Spain/04Toledo/Toledo.lua 374 1638 AO0Spain/05E...
- Sun Apr 11, 2021 4:47 pm
- Forum: Panzer Corps 2 Scenario Design
- Topic: Manuals/LuaScripting.pdf
- Replies: 1
- Views: 4885
Re: Manuals/LuaScripting.pdf
The file Content/Editor/properties.txt seems to contain an updated version of the PC2 Lua API (the bulk of the listings in pp. 1-6 of the LuaScripting document), including some new global functions: + Player::Equipment NewEquipment() + UnitType GetUnitType(string) + void Ask(Text, {caption, action},...
- Sun Apr 11, 2021 1:24 pm
- Forum: Panzer Corps 2 Scenario Design
- Topic: Lua modules
- Replies: 11
- Views: 6110
Re: Lua modules
As it turns out, the plugin used in PC2 sets package.path to a value reflecting the location of the campaign directory containing the script.lua file. e.g. ../../../PanzerCorps2/Content/Campaigns/AO0Spain/?.lua For the stand-alone scenarios in Content/Scenarios , the path is: ../../../PanzerCorps2/...
- Sat Apr 10, 2021 7:42 pm
- Forum: Panzer Corps 2 Scenario Design
- Topic: changing weathe via LUA script
- Replies: 7
- Views: 5412
Re: changing weathe via LUA script
I want to change the weather from summer, to fall, to winter - all within one scenario (Barbarossa AGC/AGN Multiplayer map). I see this going one of two ways: a) manually set all weather parameters for every turn, or a range of turns (ie a season) -or- b) adjust the percentage chances of clouds, ra...
- Sat Apr 10, 2021 6:54 pm
- Forum: Panzer Corps 2 Scenario Design
- Topic: Lua modules
- Replies: 11
- Views: 6110
Re: Lua modules
Looks interesting! The question is whether a central LUA library is easier to control than a separate LUA file for each individual scenario. So far, the developers have also opted for the separate LUA files - do you have better error control here? For some definition of "control." As of t...
- Sat Apr 10, 2021 12:12 pm
- Forum: Panzer Corps 2 Scenario Design
- Topic: Lua modules
- Replies: 11
- Views: 6110
Re: Lua modules
you may use functions from different scenarios as long as u paste and copy them in your scenario script The whole point of using modules is to avoid the copy & paste, which creates an untenable maintenance problem once there are 139 or more .lua files that have to be checked and possibly modifi...
- Fri Apr 09, 2021 12:17 am
- Forum: Panzer Corps 2 Scenario Design
- Topic: Lua modules
- Replies: 11
- Views: 6110
Lua modules
The UE4 plugin for Lua https://github.com/rdeioris/LuaMachine supports Lua 5.3 ( https://www.lua.org/manual/5.3/manual.html ), which supports modules. As it turns out, the plugin used in PC2 sets package.path to a value reflecting the location of the campaign directory containing the script.lua file...
- Thu Apr 08, 2021 9:29 pm
- Forum: Panzer Corps 2 Scenario Design
- Topic: Editor 1.1.20 hotfix
- Replies: 6
- Views: 8635
Re: Editor 1.1.20 hotfix
A feature request for the editor, to help with scripting the associated Lua file: An export to text file of the expected condition and effect function s. For example, from the Seville.pz2scn scenario, something like: -- 3 Objectives defined in scenario: -- @end Capture victory hexes Cadiz (7;24) and...
- Thu Apr 08, 2021 4:47 pm
- Forum: Panzer Corps 2 Scenario Design
- Topic: Manuals/LuaScripting.pdf
- Replies: 1
- Views: 4885
Manuals/LuaScripting.pdf
This document is out of date ( e.g. nothing about the Hero type or the campaign variable's properties). Is there anywhere that has more up-to-date information on the current API/object model? In particular, the PC2 Lua API functions used in the DLC scripts: world:Exec(action) world:MakeNewHeroAction...
- Sun Apr 04, 2021 8:13 pm
- Forum: Panzer Corps 2
- Topic: Bug Reports
- Replies: 1158
- Views: 214068
Re: Bug Reports
(Deleted)
- Sun Apr 04, 2021 7:42 pm
- Forum: Panzer Corps 2
- Topic: Bug Reports
- Replies: 1158
- Views: 214068
Re: Bug Reports
AO41 bugs (as of v1.1.21 Update) - 2 Script typos (missing s ) cause added equipment to be listed in the "Captured" category (used as default when not recognized), instead of the (intended) "Prototypes" category: OperationMercury.lua, Line 431 : AddEquipment(0, "Bf109G"...
- Wed Jul 22, 2020 2:50 am
- Forum: Field of Glory: Empires
- Topic: What Role Do Pops Play? My personal wish list for future FOG games
- Replies: 9
- Views: 1868
Re: What Role Do Pops Play? My personal wish list for future FOG games
I was just remembering back to playing Imperium Romanum II about 30 years ago, and how that reflected on Romes particular need to pull in food from the grain baskets of North Africa/Egypt. This game covers the period where supplying its citizens with grain was beginning to become important and ends...
- Wed Jul 22, 2020 2:26 am
- Forum: Field of Glory: Empires
- Topic: What Role Do Pops Play? My personal wish list for future FOG games
- Replies: 9
- Views: 1868
Re: What Role Do Pops Play? My personal wish list for future FOG games
You have modded the scripts you mean? I have, along the lines I indicated in another thread: Personally, I think the province capital regions need more emphasis / building specialization, with other regions relegated to resource production focus. Otherwise, the identical builds in all regions get r...
- Sat Jul 18, 2020 4:15 pm
- Forum: Field of Glory: Empires - Tech Support
- Topic: STRUCTURES Forbidden Terrain fix
- Replies: 4
- Views: 1206
Re: STRUCTURES Forbidden Terrain fix
The code in Faction.bsf/Faction_Construct_StructureIsAllowed_Internal() is kinda crufty, and I see the notes to remind yourself to clean it up. A couple of other checks to include: if Structure_IsBeingDisassembled() for required and/or precursor/upgrade structures after the (successful? checked?) ca...
- Wed Jul 15, 2020 7:45 pm
- Forum: Field of Glory: Empires
- Topic: How much food do I need to produce a new population?
- Replies: 12
- Views: 2283
Re: How much food do I need to produce a new population?
Nice, so most of the game is in the .bsf files!!! Pretty much. The rules/logic and UI code, anyway. The data live in the DATA directory's .csv files (generated from the .xlsx spreadsheets, per: http://www.slitherine.com/forum/viewtopic.php?f=562&t=99539 ). The BSF files are text files containin...
- Wed Jul 15, 2020 1:16 pm
- Forum: Field of Glory: Empires
- Topic: How much food do I need to produce a new population?
- Replies: 12
- Views: 2283
Re: How much food do I need to produce a new population?
I don't know what these numbers are. POP_FOOD_POPULOUS_MINVAL,POP_FOOD_POPULOUS_RATIOh,POP_FOOD_POPULOUS_COEFF These are constants defined in MapGlobals.bsf . A few have some commentary hints: // *** P_ *** // __POPULATION #define POP_REALNUMBERCOEFF 10000 #define POP_BASE_NEED_FOOD 15 #define POP_...
- Tue Jul 14, 2020 9:31 pm
- Forum: Field of Glory: Empires
- Topic: A quick review and some suggestions
- Replies: 11
- Views: 2368
Re: A quick review and some suggestions
I ended up doing my best to avoid taking regions that I couldn't quickly form into provinces because of this. Seems to be the optimal strategy, especially given the decadence calculations. Also, there is the new "Liberate Region" Regional Decision. Personally, I think the province capital...