Home » MODDING HQ 1.13 » Flugente's Magika Workshop » Absurdly small code changes
() 1 Vote
Absurdly small code changes[message #313897]
|
Fri, 04 January 2013 22:49
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
I feel a few code changes are too small to justify their own thread, but still need to be posted somewhere, as they otherwise get forgotten until people shout 'BUG!!!' a few years later. So I'll pin them up here.
First entry (Exe r5763 &GameDir 1583): the option NO_STANDING_ANIM_ADJUSTMENT_IN_COMBAT in the ini allows the following small change:
If we are in turnbased combat and are moving to a location, we do not change our animation to standing/crouching/prone. This way, we do not have to spend additional APs if we get moving again. This is similar to what happens if we are interrupted while running; we can simply 'pick off' where we left.
This allows the player to move in smaller sections, for example, if we want to move a long way but the game pathing is not to our liking.
[Updated on: Fri, 04 January 2013 22:51] by Moderator Report message to a moderator
|
|
|
|
|
|
Re: Absurdly small code changes[message #313946]
|
Sun, 06 January 2013 05:16
|
|
Flugente |
|
Messages:3507
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.
Report message to a moderator
|
|
|
|
|
|
|
|
Re: Absurdly small code changes[message #313962]
|
Sun, 06 January 2013 19:38
|
|
Sam Hotte |
|
Messages:1965
Registered:March 2009 Location: Middle of Germany |
|
|
But we could easily add a ready time to mortars like any other weapon, couldn't we?
Edit: I'm aware that we also should have a proper animation then for this. i'm just talking theory currently; trying to understand how things work (or don't).
Edit
[Updated on: Sun, 06 January 2013 19:48] by Moderator Report message to a moderator
|
Sergeant Major
|
|
|
|
|
Re: Absurdly small code changes[message #313965]
|
Sun, 06 January 2013 19:59
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
Ah, now I get your intention. Yes that would be pretty easy actually for weapons that target a tile and not a person. Though a bit odd, as you'd only fire if you've accumulated enough APs. So if you are not planning careful, you might shoot later than you originally intended if you spend too much APs on other stuff.
[Updated on: Sun, 06 January 2013 20:00] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Absurdly small code changes[message #315989]
|
Wed, 06 March 2013 01:34
|
|
Flugente |
|
Messages:3507
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.
Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: Absurdly small code changes[message #316749]
|
Fri, 29 March 2013 23:38
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
That is an unfortunate sideeffect. We were never able to give an item to someone who is in a moving animation - which was no problem till now as we barely ever had the chance to try.
The corresponding checks are... nested in a way that makes changing this relatively hard. The reason is that handles generally clicking on persons, and I'd rather not mess with this.
As a workaround, you have to either switch stance, look in another direction, or switch weapons in your hands (changes anim if you have a rifle, and does not cost APs if you do it by rightclicking on the roster).
[Updated on: Fri, 29 March 2013 23:39] by Moderator Report message to a moderator
|
|
|
|
|
|
|
|
|
|
Re: Absurdly small code changes[message #316998]
|
Wed, 03 April 2013 22:08
|
|
Istrebitel |
|
Messages:212
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 Report message to a moderator
|
Sergeant 1st Class
|
|
|
Goto Forum:
Current Time: Fri Jan 17 11:11:41 GMT+2 2025
Total time taken to generate the page: 0.02544 seconds
|