Home » MODDING HQ 1.13 » Flugente's Magika Workshop » Absurdly small code changes
( ) 1 Vote
| | |
Re: Absurdly small code changes[message #313946] |
Sun, 06 January 2013 05:16   | |
Flugente
|
 |
Messages:3453
Registered:April 2009 Location: Germany |
|
|
Another feature, that most people wont even notice, because it is so small, are the new multi-turn actions. It is basically a system that allows a coder to set an action to be performed over multiple turns. Once you start the action, a few APs are deducted, a small icon signifies that the emrc is now performing an multi-turn action. He can still do anything as usual, but:
At the end of the turn, we look at his remaining APs. If has any left, we deduct these from the total AP cost of the action he is performing. Once he ha fully paid the cost, the action will be finished. If he is not able to do the action, it is cancelled, but we do not regain any spent APs for it.
As a demonstration, building/removing/filling sandbags is now a multi-turn action.

Boss demonstrates mulit-turn actions. He begins building a sandbag barricade, but continues to fire at enemies. At the end of the turn, he has switched position, but is still facing the same tile on which he originally started building. After a few turns, he is finished, the sandbag barrier stands.
Had he not looked at the same tile at the end of his turn, or had he not had a sandbag in his main hand, or had the tile been occupied, he would have stopped building (a message will appear in that case).
If in realtime and not in combat, actions are still performed instantly. No need to wait 15 seconds for building a sandbag there.
It was previously criticized that building sandbags is too fast, thus giving an unfair advantage to the player. With this feature, building takes multiple turns (governed by the AP cost in APBPConstants.ini). So you can now build sandbags in turnbased mode, but it will keep you occupied for several turns. You can still defend yourself, but you must return to the building site every turn.
This feature was added to th trunk in r5778 and requires GameDir of revision >= 1589 (due to the added constants and the icon). It is a new savegame version but does NOT break savegame compatibility.
|

|
|
| | | | | | | | | | | | | | | | | | | | | | |
Re: Absurdly small code changes[message #315989] |
Wed, 06 March 2013 01:34   | |
Flugente
|
 |
Messages:3453
Registered:April 2009 Location: Germany |
|
|
I upgraded weapon switching (r5900):
new key combinations:
- SHIFT + K: switch to and from riflesling
- SHIFT + K + ALT: switch to knife, or from knife to gun
- SHIFT + K + CTRL: switch to sidearm, or from sidearm to non-sidearm gun
the switches will search for a valid spot for the replaced hand items, thus a LAW won't go into a holster etc.
The functions are mildly intelligent. If you have an AR in your hand and give the command to switch to your knife, the AR will be moved to the first slot in your inventory hat can take the AR. This will not work, of course, if no slot is found. This also does not retrieve guns/knives from stacks.
Sidearms in this context are all guns of the HANDGUNCLASS (1 in Weapons.xml).
Note that sidearms are not automatically stored in holsters, as there is no easy way to tell if a slot is in a holster or a vest. Okay, there actually is, but this is pointless since we have vest with holsters and whatnot nowadays. They are simply placed in the first free slot.
Knifes, however, will always be put back to the knifeslot if its empty and they fit - because that slot is not governed by LBE and comes pretty early in the slot loop.
|

|
|
| | | | | | | | | | | | |
Re: Absurdly small code changes[message #316998] |
Wed, 03 April 2013 22:08   | |
Istrebitel
|
  |
Messages:222
Registered:December 2009 Location: Russia, Saint-Petersburg |
|
|
This is logical, I agree, but however logical it is, it is useless right now.
It is as logical as a famous (at least in Russia) joke (I hope I translated it correctly, because I couldn't find it's version in english by googling):
Sherlock Holmes and Dr. Watson are flying in a hot air balloon. They got lost and don't know where they are because of a dense fog. Suddenly they were floating near a skyscrapper which had an open window with a man sitting inside. Holmes asks the man:
- "Sir, could you please tell me where we are?"
- "Of course, sir, you are in a hot air balloon!" - the man answered.
After parting with the man, Holmes tells Watson:
- "I know for sure Watson that this man was a programmer".
- "How could you know that, Holmes?" - asks Watson.
- "He gave us an absolutely correct, but at the same time an absolutely useless answer".
Basically, this is useless, because in order to use SHIFT+ALT+K, I have to forget about using SHIFT+K, which makes no sense (and forget about using my rifle sling slot, which also makes no sense).
Therefore, please consider the following logic:
If we have more than one large gun in our inventory, as a sane individual, we would most likely place one of them in the rifle sling slot, because that slot can only hold an item of this type (and a machete, I belive, as a unique exclusion from this rule).
In this case, if we use SHIFT+ALT+K command to take a knife out, where would the weapon we had in our hand go? It cannot go to the sling, therefore it goes into our inventory (combat pack, or if no slots are there, big backpack).
This means that if we use SHIFT+ALT+K command to place the knife back, where should we look for a weapon we previously had in our hand? Not on the sling, but in the inventory.
Therefore, logic for SHIFT+ALT+K command in case we have a knife in our hand should be like this:
- if we have one big weapon in the inventory, start from the sling slot and then go on to the rest of the inventory
- if we have more than one big weapon in the inventory, then start with inventory and check sling slot last
However, since if we have only one weapon in the inventory, it doesn't matter in which order do we look - we will still find the same item.
Therefore, it is more logical to start with inventory and check the sling LAST.
[Updated on: Wed, 03 April 2013 22:10] by Moderator
|
|
|
|
Goto Forum:
Current Time: Sat Feb 23 05:01:19 EET 2019
Total time taken to generate the page: 0.02519 seconds
|