Commit Graph

79 Commits

Author SHA1 Message Date
Mark Vejvoda
b178b1d1e9 - fixed messagebox word wrap with lua messages 2012-11-08 23:54:43 +00:00
Mark Vejvoda
61ffcf8252 - cleaned up compiler warning 2012-10-22 06:44:38 +00:00
Mark Vejvoda
64058b17e7 - code cleanup from cppcheck
- added more checks when loading models, maps and textures
2012-10-20 07:15:13 +00:00
Mark Vejvoda
011e0263b0 - lots more code cleanup, using safe buffer size code to avoid buffer overflows 2012-10-19 01:31:20 +00:00
Mark Vejvoda
e86cb3aeff - more code cleanup based on suggestions from cppcheck 2012-10-18 08:16:47 +00:00
Mark Vejvoda
505206059b - added new lua method for Muwuum:
void giveStopCommand(int unitId)
	bool selectUnit(int unitId)
	void unselectUnit(int unitId)
	void addUnitToGroupSelection(int unitId,int groupIndex)
	void recallGroupSelection(int groupIndex)
	void removeUnitFromGroupSelection(int unitId,int group)
	void setAttackWarningsEnabled(bool enabled)
	bool getAttackWarningsEnabled()
2012-10-17 20:15:50 +00:00
Mark Vejvoda
e63e634e1e - added a bit more lua and updated capture enemy flag 2012-10-13 07:33:33 +00:00
Mark Vejvoda
0180aa6bba - added new lua functions:
triggeredCellEventUnitId()
showMarker(int flashCount, int factionIndex, string note, string textureFile,Vec2i pos)

1. The first one can be called in a cell trigger event and tell you which unit triggered the event
2. The second flashes a position in the minimap
2012-10-13 05:06:53 +00:00
Mark Vejvoda
6b324cbb4e - added second round of security sandboxing for lua scripts (disable a number of other potentially dangerous functions) 2012-10-11 06:10:21 +00:00
Mark Vejvoda
e3e3832070 - added first round of security sandboxing for lua scripts (disable the os library) 2012-10-11 05:17:37 +00:00
Mark Vejvoda
5c0090d488 - bug fixes for free cell lua functions 2012-10-10 19:56:52 +00:00
Mark Vejvoda
4a63060b71 - added two new lua functions:
networkSetCameraPositionForFaction(int factionIndex,Vec2i pos)
networkSetCameraPositionForTeam(int teamIndex, Vec2i pos)
2012-10-10 18:28:55 +00:00
Mark Vejvoda
84452f8633 - added new cell trigger lua function to be able to detect when any unit enters or exits a region of cells:
int registerCellAreaTriggerEvent(Vec4i pos)
int getCellTriggeredEventAreaEntryUnitId();
int getCellTriggeredEventAreaExitUnitId();
2012-10-10 05:44:14 +00:00
Mark Vejvoda
165f281f92 - added a few new lua functions to check if a cell is free 2012-10-09 20:03:09 +00:00
Mark Vejvoda
5e42c6dc03 - loads of code cleanup based on verbose output from the latest git version of cppcheck 2012-10-06 07:06:40 +00:00
Mark Vejvoda
7c0e10684a - added lua functions to add / remove cell markers:
addCellMarker(0,'test from scenario!','',cellMarker)
param1=factionindex
param2=cell hint
param3=empty string
param4=cellPosition

removeCellMarker(0,{46,13})
param1=factionindex
param2=cellPosition
2012-09-25 07:05:52 +00:00
Mark Vejvoda
76606fbdbe - allow loading of scenarios and tutorials when there are none (show an error message) 2012-06-30 19:11:54 +00:00
Mark Vejvoda
8fd436b612 - added new lua method to play video's in scenarios:
playStaticVideo
2012-05-22 06:17:56 +00:00
Mark Vejvoda
0f25276e6f - applied patch from MuwuM 2012-05-21 20:15:37 +00:00
Mark Vejvoda
5c0db25c86 - added a few new lua methods to register cell 'areas' for unit or for factions for wciwow 2012-05-02 06:07:11 +00:00
Mark Vejvoda
c8fdc9269f - fix win32 build
- cleanup a lot of win32 compiler warnings
2012-04-16 20:15:57 +00:00
Mark Vejvoda
8c0bf75bf5 - got built in memory leak working. Just edit leak_dumper.h and uncomment:
//#define SL_LEAK_DUMP
- got better / more accurate stack dumps when we detect errors in game.
- Both of these need to be worked on in windows next, win32 may not compile for now until i fix it on that platform.
- BE VERY CAREFUL when working in leak_dumper.* it may cause GCC and your system to crash if you don't know what you are doing!
2012-04-14 21:21:09 +00:00
Mark Vejvoda
22f43f4267 - added new lua method for setting the direct position of a unit (can be used for teleporting):
setUnitPosition(int unitId, Vec2i pos)
2012-04-11 05:41:40 +00:00
Mark Vejvoda
2ab041813f - code cleanup based on cppcheck report 2012-04-05 03:53:59 +00:00
Mark Vejvoda
74910ea0b2 - bugfix for loading saved scenario 2012-03-31 20:33:56 +00:00
Mark Vejvoda
152e83399d - added a new lua method isUnitAlive(unitId) 2012-03-31 20:17:19 +00:00
Mark Vejvoda
53d0204cb9 - bugfix network messages 2012-03-31 00:52:43 +00:00
Mark Vejvoda
fa31fed5bd - updated to add isGameOver 2012-03-30 14:48:54 +00:00
Mark Vejvoda
c02c90427b - added some more lua commands:
vector<int> getUnitsForFaction(factionIndex,commandTypeName, field)
int getUnitCurrentField(unitId)
2012-03-30 07:10:14 +00:00
Mark Vejvoda
45b92f4316 - allow for a scenario based faction to be 'neutral' by specifying a team # of 9
- added some new lua methods:
networkShowMessageForFaction(text,header,int factionIndex)
networkShowMessageForTeam(text,header,teamIndex)
2012-03-30 05:53:33 +00:00
Mark Vejvoda
f7423608ce - bugfix for lua strings 2012-03-30 01:48:41 +00:00
Mark Vejvoda
435e06db20 - attempt to bugfix lua save/load games, added a new section for scenario files called:
<global>
</global>
Where global vars (but more importantly declared functions) should be declared
- updated amazones scenario to move globals into the global section
2012-03-29 22:30:58 +00:00
Mark Vejvoda
8a2b90895d - auto stop efficient timer event after it is triggered 2012-03-27 19:28:16 +00:00
Mark Vejvoda
d25fc14244 - added some new 'predictable' random number generation for use in lua scripts 2012-03-27 07:05:07 +00:00
Mark Vejvoda
5cc39e7c53 - added a new type of lua script timer for efficient checking of elapsed time 2012-03-27 06:42:55 +00:00
Mark Vejvoda
4f1bee5aea - attempt to save and load scenario info in saved games 2012-03-26 06:48:58 +00:00
Mark Vejvoda
9d6607a051 - added new lua method so users can create units without spacing rules:
createUnitNoSpacing
2012-02-21 21:56:20 +00:00
Mark Vejvoda
ced374410c - added GAE compatible stubs for a few new lua methods 2012-01-05 20:01:22 +00:00
Mark Vejvoda
e351def1cb - added new lua function to display playername:
getPlayerName(i)
2012-01-05 00:45:17 +00:00
Mark Vejvoda
6f924b310d - added new lua method to get system macro values:
dofile(getSystemMacroValue("$SCENARIO_PATH") .. "unit.ai.class.lua")
2012-01-05 00:04:55 +00:00
Mark Vejvoda
ec2f889a76 - scenario pause command should work in network mode 2011-12-28 07:26:16 +00:00
Mark Vejvoda
d33e1174a5 - bugfixes related to cppcheck report
- bugfixes found using valgrind (memory leaks)
2011-12-02 16:07:59 +00:00
Mark Vejvoda
f626ebbe45 - attempt to fix lua code to properly get unit's killer:
lastDeadUnitKillerName
lastDeadUnitKiller
2011-11-18 15:43:05 +00:00
Mark Vejvoda
d29293d3cf - added new lua method lastDeadUnitCauseOfDeath, possible int values are:
None = 0
	Attacked = 1
	AttackBoost = 2
	StarvedResource = 3
	StarvedRegeneration = 4
2011-11-16 21:43:19 +00:00
Mark Vejvoda
2d367bd26e - added new lua functions from Muwum:
new events:
    unitAttacked
   unitAttacking
 
   methods:
   lastAttackedUnitName()
   lastAttackedUnit()
   lastAttackingUnitName()
   lastAttackingUnit()
   giveKills(unit,amount)
2011-11-16 21:38:12 +00:00
Mark Vejvoda
b2adc16ca6 - added Muwums lua function 2011-11-15 17:39:49 +00:00
Mark Vejvoda
4930ec109d added a new lua method from Muwuum 2011-11-03 18:24:02 +00:00
Mark Vejvoda
5b0c3accfc changed lua method to camelcase 2011-11-03 17:04:49 +00:00
Mark Vejvoda
b126768d9c - updated scenario lua function to allow carry over of factions or not 2011-10-06 20:44:55 +00:00
Mark Vejvoda
2d42f59fe1 - added a new lua function to allow loading a new scenario from inside an existing scenario
loadScenario('capture_the_flag2')
2011-10-06 18:04:59 +00:00