i would like to know how to script who and when to attack someone attacking the player, when he puts away his weapon, and when to follow.
also how to make him warp back to his original position when i tell him to.
it would help so much. thanks
Help scripting dialogue and scripts for mercenary-like npc
Moderators: Haplo, Lead Developers
Ok, let me get this straight you want to
A: Have someone follow the player and protect him from other attackers,
OR
B: Have someone attack the player and when the player puts his weapon away stop attacking.
A:
OK, to have the NPC escort the character to a location out side use this:
Where LEADER ID is the ID of the character you want the NPC to follow(can be an NPC ID OR "Player" for the NPC to follow the player) NPC ID is the ID of the NPC, duration is how long you want the NPC to follow the player (Set to 0 if you want the NPC to follow indefinitely), x is the X location to go to, y the y location, and z the z location (Set X,Y, and Z to 0 to make the NPC follow everywhere).
To have the NPC escort the character to an interior cell use this:
Where the variables are the same as above EXCEPT the XYZ coordinates are for an interior cell and you must specify what cell for CELL ID.
Using either of these methods will make the NPC protect the character it is following.
B:
To start comabat with the player use:
To check to see if the player has their weapon put out/away and stop combat use this:
Both of the codes are just segments, If you could expand upon the script you want I could easily create it for you!
Hope that Helps!
EDIT: Oops , I messed up on the script, fixed it now....
A: Have someone follow the player and protect him from other attackers,
OR
B: Have someone attack the player and when the player puts his weapon away stop attacking.
A:
OK, to have the NPC escort the character to a location out side use this:
Code: Select all
"NPC ID"->AIEscort, "LEADER ID", duration, x, y, z
To have the NPC escort the character to an interior cell use this:
Code: Select all
"NPC ID"->AIEscortCell, "LEADER ID", "Cell ID", duration, x, y, z
Using either of these methods will make the NPC protect the character it is following.
B:
To start comabat with the player use:
Code: Select all
StartCombat, Player
Code: Select all
If ("Player"->GetWeaponDrawn == 0)
StopCombat, Player
Endif
Hope that Helps!
EDIT: Oops , I messed up on the script, fixed it now....
my idea again
i would think that the 1ST option would be better...... so much better than having someone come around with u and attack u >< what fun would that be when u can simply blow his head off with a single shot from a bow and arrow? i mean, come on.......... i vote for number 1
p.s.: get with it
p.s.: get with it
- Stumpytheguar
- Member
- Posts: 631
- Joined: Sun Jun 27, 2004 2:22 am
- Location: Irrelevant
-
- Developer Emeritus
- Posts: 1649
- Joined: Tue Aug 17, 2004 5:12 am
- Location: DC, USA
Scripting Mercenaries is quite fun, I may ask to see somthing small like that in here.
One of my major personal projects in Morrowind was to Script three mercenaries, one, a Healer, an archer, and a Fighter/Necromancer sort of hybrid.
The Healer and Necromancer had their own form of mana (quite hard, actually) And when you gained a level, they would too, I used the actual formulas from morrowind to determine their new stats.
So if you hit level 10, they would reach level 10 as well, and all their stats would change accordingly.
The healer was my pride and joy, it was very advanced, and quite smart.
In dialogue, you could tell her to heal you at a certain % of health (75, 50 and 25) and until your health got to that point she would fight alongside you. She had her own special Mana programmed in (as far as I could tell Mobs sort of ignored Mana, so I had to make my own using a script), and every 10 seconds she would regenerate a mana point
Every level she gained, you could go to a Mercenary trainer to actually purchase new spells for her to use, such as gaining 2 mana points instead of 1, or summoning another creature to help heal you (but if it got hit it would die.) You couldnt buy them all at once, as you could only get one training point a level, and each cost money (Some of the better abilities cost quite a bit)
There was a lot more to it than just that, too, but if one of your other mercenaries was hurt, they would call for help, and she would heal them just as she would heal you (now that took some out of the box thinking).
Maybe I'll post it on here some day, but, Its quite dirty, there are snippets from somthing else I was working on.
Needless to say, it made the game feel like you were actually a part of somthing. Each had their own mini-quest you could do to gain items specific to them. If they died, you could bring them back to life in certain places (If one died in Vivec, you may have to travel all the way north to bring them back to life)
Anyhow, you probably didnt want to hear all that. :p
Bust most of all, they werent overpowered, but balanced just right.
You would be able to take on things, perhaps, 4 or 5 levels before you should.
High level mobs would simply outdamage the Healers healing (or draw the fight out so long she'd run out of Mana and not be able to heal)
One of my major personal projects in Morrowind was to Script three mercenaries, one, a Healer, an archer, and a Fighter/Necromancer sort of hybrid.
The Healer and Necromancer had their own form of mana (quite hard, actually) And when you gained a level, they would too, I used the actual formulas from morrowind to determine their new stats.
So if you hit level 10, they would reach level 10 as well, and all their stats would change accordingly.
The healer was my pride and joy, it was very advanced, and quite smart.
In dialogue, you could tell her to heal you at a certain % of health (75, 50 and 25) and until your health got to that point she would fight alongside you. She had her own special Mana programmed in (as far as I could tell Mobs sort of ignored Mana, so I had to make my own using a script), and every 10 seconds she would regenerate a mana point
Every level she gained, you could go to a Mercenary trainer to actually purchase new spells for her to use, such as gaining 2 mana points instead of 1, or summoning another creature to help heal you (but if it got hit it would die.) You couldnt buy them all at once, as you could only get one training point a level, and each cost money (Some of the better abilities cost quite a bit)
There was a lot more to it than just that, too, but if one of your other mercenaries was hurt, they would call for help, and she would heal them just as she would heal you (now that took some out of the box thinking).
Maybe I'll post it on here some day, but, Its quite dirty, there are snippets from somthing else I was working on.
Needless to say, it made the game feel like you were actually a part of somthing. Each had their own mini-quest you could do to gain items specific to them. If they died, you could bring them back to life in certain places (If one died in Vivec, you may have to travel all the way north to bring them back to life)
Anyhow, you probably didnt want to hear all that. :p
Bust most of all, they werent overpowered, but balanced just right.
You would be able to take on things, perhaps, 4 or 5 levels before you should.
High level mobs would simply outdamage the Healers healing (or draw the fight out so long she'd run out of Mana and not be able to heal)
-
- Developer
- Posts: 811
- Joined: Thu Aug 21, 2003 10:56 am
- Location: Dreamland