Function for acquiring upgrades in-game
Bug #1331628 reported by
Andre Novellino Gouvêa
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Stratagus |
Fix Released
|
Undecided
|
cybermind |
Bug Description
Attached to this report is a patch that creates a Lua function for acquiring upgrades during a game (using DefineAllow during a game didn't apply the appropriate modifiers).
The function is called "AcquireUpgrade" and takes two arguments: the first argument is the number of the player who will acquire the upgrade, and the second argument is the upgrade's ident.
Related branches
Changed in stratagus: | |
status: | Fix Committed → Fix Released |
milestone: | none → 2.3 |
To post a comment you must log in.
Improved version of this code, as discussed in the Stratagus conference:
https:/ /dl.dropboxuser content. com/u/1732902/ Wyrmsun/ Stratagus% 20Patch/ script_ player. cpp /dl.dropboxuser content. com/u/1732902/ Wyrmsun/ Stratagus% 20Patch/ upgrade. cpp
https:/
This makes the upgrade be acquired or lost through the SetPlayerData function (via "HasUpgrade"), and the UpgradeLost function now works properly, reversing the upgrade's modifiers accordingly.
Example of how this would be used through Lua: dwarven- broad-axe" , true) -- makes player 0 acquire the dwarven broad axe upgrade
SetPlayerData(0, "HasUpgrade", "upgrade-