If a necromancer were to make a deal with like 4 people before a fight that the necromancer could animate them if they die during the fight, and then those same 4 people were to die, would those 4 people be more friendly when they were reanimated than most skeletons/zombies? Or would they just be as aggressive as regular undead?
The personality of skeletons and zombies and the relationship of such to who they were in life passes entirely without comment in published material at this date. We know that the creatures created by Animate Dead are:
- Neutral Evil, whatever that means in your setting
- Unable and/or unwilling to do anything you don't command them to do except 'defend[s] [themselves] against Hostile creatures', which itself can be interpreted in a variety of ways
- When they go uncontrolled, they don't start doing anything: they just stop obeying any commands you've given them. They do nothing except defend themselves against hostile creatures until they are destroyed.
We further know about skeletons that:
[Their animating force] motivates a skeleton to move and think in a rudimentary fashion, though only as a pale imitation of the way it behaved in life.
An animated skeleton retains no connection to its past, although resurrecting a skeleton restores it body and soul, banishing the hateful undead spirit that empowers it.
Independent skeletons temporarily or permanently free of a master's control sometimes pantomime actions from their past lives.
When skeletons encounter living creatures, the necromantic energy that drives them compels them to kill unless they are commanded by their masters to refrain from doing so.
There is an obvious contradiction between having no connection to their past lives and pantomiming actions from their past lives. Nevertheless, that's what the Monster Manual says.
Ultimately, regardless of published information and in particular given the contradictory and sparse nature of such information, your DM is going to have to come up with how skeletons work. They might decide the hateful animating spirit of a skeleton hates you, for example, though there's no particular textual indication that must be so, or they might decide the skeletons' hateful animating spirit is somehow shaped by the soul of the animated corpse and certain kinds of contracts can persevere across death. You need to ask your DM if skeletons can be made in such a way that your idea works or not, the books provide neither an affirmative nor negative answer, just as they do not specify that skeletons have "regular aggression".
We further know about zombies that:
A zombie retains no vestiges of its former self, its mind devoid of thought and imagination.
Zombies have 3 INT, 6 WIS, and 5 CHA
A zombie left without orders simply stands in place and rots unless something comes along that it can kill. The magic animating a zombie imbues it with evil, so left without purpose, it attacks any living creature it encounters.
A zombie can follow simple orders and distinguish friends from foes
Zombies, unlike skeletons, do not have contradictory MM material. The statement about not having thoughts is wrong, but is easily read as an exaggeration. Zombies have no real connection at all to their past lives in the published material, and your DM would be changing that in letting them have a different attitude towards you based on pre-death agreements. That's not to say you shouldn't investigate that-- your DM is already away from published sources in deciding that zombies created by the spell have "aggression", so assuming your DM is unwilling to let you find a way to accomplish what you are looking for is probably unwise.
It doesn't usually matter
While it may well work differently in your DM's game (it certainly does sometimes in mine), in the most by-the-book way of running 5e, it doesn't really matter if your undead skeletons/zombies hate you or not. Before the spell wears out, they obey your commands. Afterwards, they do nothing (the descriptions in the MM are for undead made in different ways). As long as you aren't Hostile towards them they won't attack you and they do their best to accomplish what you direct them to do, whether they like it or not.
There are a few spells that can be used to re-animate the dead, all with varying effects, from being the shambling undead zombies every necromancer knows and loves, to bringing the dead completely back to life, as if they had never died to begin with.
Each of these spells have their own specific effects, as outlined in the spell's descriptions. For example, Animate Undead states (PHB p. 212; emphasis mine):
This spell creates an undead servant. Choose a pile of bones or a corpse of a Medium or Small humanoid within range. Your spell imbues the target with a foul mimicry of life, raising it as an undead creature. [...] The creature is under your control for 24 hours, after which it stops obeying any command you've given it. To maintain control of the creature for another 24 hours, you must cast this spell on the creature again before the current 24-hour period ends.
This description of a Zombie states (MM p. 315; emphasis mine):
A zombie retains no vestiges of its former self, its mind devoid of thought and imagination. A zombie left without orders simply stands in place and rots unless something comes along that it can kill. The magic animating a zombie imbues it with evil, so left without purpose, it attacks any living creature it encounters.
So, following the RAW, once the effects of the spell ends, the Zombie will act on its base urges, and attack at will, regardless of any promises made before death.
Depending on the spell you use for this, by default, a zombie that is devoid of a "master" will become the mindless creature that will attack anyone, regardless, but you could discuss this with your DM, and perhaps create some kind of magical or spiritual bond with the creatures you are aiming to revive. This way, since the creatures technically still have their "souls" (by means of the bond created before death), after the effect of the spell ends, they won't lash out, but simply remain entirely passive until the appropriate spell to retain control over them is applied once again.
The spell says the animated undead are "a foul mimicry of life", implying their decisions in life have no more effect on them mentally. The spell also says "The target becomes a skeleton if you chose bones or a zombie if you chose a corpse (the GM has the creature’s game statistics)", meaning the zombies/skeletons you make are no different from a random one you might encounter, except for appearance.
Also, when a creature retains its alignment and personality after being targeted by a shapeshifting feature/spell, it explicitly says so, for example, Polymorph says "It retains its alignment and personality." Additionally, given a zombie's INT score of 3, and Neutral Evil alignment, it is unlikely to remember who you are and help you even if it wasn't a separate creature. Finally, zombies can still be targeted by True Resurrection, as stated in the MM: "Once turned into a zombie, a creature can't be restored to life except by powerful magic, such as a resurrection spell. (Raise Dead and Revivify cannot do this though)"; this implies that zombies are a distinct entity from their original person.