I need to be able to attack neutrals in my campaign. I know there is a setting on the campaign editor which is a true/false setting. Is it as simple as changing this? I want to get some people with exeperience to weigh in here jsut in case fiddling with these options can break my campaign.
Thanks.
Attacking Neutrals
Débuté par
M. Rieder
, nov. 28 2010 08:03
#1
Posté 28 novembre 2010 - 08:03
#2
Posté 29 novembre 2010 - 03:56
You need to script it. The one that is most common would be “ga_attack” found in your TS. I also have one for triggers. Here one I made with the script generator. *untested*
*nwscript*
//Put this script OnEnter
#include "nw_i0_generic"
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
object oTarget;
oTarget = GetObjectByTag("TagofCreature");
AdjustReputation(oPC, oTarget, -100);
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
AssignCommand(oTarget,
DetermineCombatRound(oPC));
}
//end script
*nwscript*
//Put this script OnEnter
#include "nw_i0_generic"
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
object oTarget;
oTarget = GetObjectByTag("TagofCreature");
AdjustReputation(oPC, oTarget, -100);
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
AssignCommand(oTarget,
DetermineCombatRound(oPC));
}
//end script
#3
Posté 29 novembre 2010 - 07:49
In my exp you do need to be a little careful fiddling with the factions. Targeting individuals as per Alupinus answer is safer than making a block change. Although I think the script is going to make the neutrals attack you (making them hostiles). If you want to be able to attack a neutral but have them neutral until the event then I think something different is called for.
All sorts of odd things can start to happen if you are not careful, for instance we get the occasional my npc has dissappered thread her on the forums. That happened to me when I used the Daegun blueprint as a convo horse in sheep and stone. My character entered the market and everyone was gone - I use uncleFB's npc control and anyone who has will know that missing npc's happens from time to time so I was vexed. I did not solve the problem till I spawned into the market at mod start and caught Daegun shooting everybody.
You might want to consider a custom factions for the persons you want to be able to atack. That way you can prevent other coming to their aid?
Cheers
PJ
All sorts of odd things can start to happen if you are not careful, for instance we get the occasional my npc has dissappered thread her on the forums. That happened to me when I used the Daegun blueprint as a convo horse in sheep and stone. My character entered the market and everyone was gone - I use uncleFB's npc control and anyone who has will know that missing npc's happens from time to time so I was vexed. I did not solve the problem till I spawned into the market at mod start and caught Daegun shooting everybody.
You might want to consider a custom factions for the persons you want to be able to atack. That way you can prevent other coming to their aid?
Cheers
PJ
Modifié par PJ156, 29 novembre 2010 - 07:52 .
#4
Posté 29 novembre 2010 - 09:32
you need to change some default script so they'll turn hostile when attacked.
#5
Posté 29 novembre 2010 - 05:29
You can have a simular script for "On Physically Attacked Script”.
//nwscript
//Can go OnDamaged, OnDisturbed, OnSpellCastAt, creature heartbeats, etc.
#include "nw_i0_generic"
void main()
{
object oPC = GetLastHostileActor();
if (!GetIsPC(oPC)) return;
object oTarget;oTarget = GetObjectByTag("TagofCreature");
AdjustReputation(oPC, oTarget, -100);
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
AssignCommand(oTarget, DetermineCombatRound(oPC));
}
//EndofScript
//nwscript
//Can go OnDamaged, OnDisturbed, OnSpellCastAt, creature heartbeats, etc.
#include "nw_i0_generic"
void main()
{
object oPC = GetLastHostileActor();
if (!GetIsPC(oPC)) return;
object oTarget;oTarget = GetObjectByTag("TagofCreature");
AdjustReputation(oPC, oTarget, -100);
SetIsTemporaryEnemy(oPC, oTarget);
AssignCommand(oTarget, ActionAttack(oPC));
AssignCommand(oTarget, DetermineCombatRound(oPC));
}
//EndofScript
Modifié par Alupinu, 29 novembre 2010 - 05:30 .
#6
Posté 30 novembre 2010 - 03:36
Some clarification is called for. I need to be able to cast certain spells on neutral creatures which are generally only able to be cast at hostile creatures. For example if I want to heal a neutral fire elemental, I would want to cast a fireball at it. If I change the elemental to hostile, then it attacks and things get messy. I want it to stay neutral, but be able to target it with hostile spells.
#7
Posté 30 novembre 2010 - 06:30
Crazy idea: How about fire a script (pun intended) that immobilizes the creature, then changes it's faction, spell is cast, spell effect occurs, faction changed back, de-immobilize creature?
Is that possible? (and that's to anyone with the chops to answer, not just M.Rieder.)
dno
Is that possible? (and that's to anyone with the chops to answer, not just M.Rieder.)
dno
#8
Posté 02 décembre 2010 - 01:13
You need to alter the spell script for this, and change its effect depending of the target, just like it's done for the healing spell.
#9
Posté 04 décembre 2010 - 03:25
The problem I'm running into isn't what happens into the scripting, but the fact that currently, you can't even target a neutral with a hostile spell. For example, if I wand to scare the daylights out of a pig with the spell "cause fear" and the pig's faction is neutral, I cannot even select the pig as a target. The cursor will not light up the creature. This is what I would like to change.
Is there some master script that controls what you can and cannot highlight with the cursor, or is it hard-coded?
Is there some master script that controls what you can and cannot highlight with the cursor, or is it hard-coded?
#10
Posté 04 décembre 2010 - 03:28
dunniteowl wrote...
Crazy idea: How about fire a script (pun intended) that immobilizes the creature, then changes it's faction, spell is cast, spell effect occurs, faction changed back, de-immobilize creature?
Is that possible? (and that's to anyone with the chops to answer, not just M.Rieder.)
dno
I was thinking along these lines for a work-around if I can't make it work directly. This could be done, but I can only think of 2 ways to do it right now. One is with a dialogue window (bulky and not that fun), or by uising items that you cast spells on that become other items which you use on the neutral character and then produce the same effect as the spell you wanted to cast. This will be pretty user-friendly and will be almost as smooth as just casting the spell, but it will be alot of work to implement.
#11
Posté 04 décembre 2010 - 03:40
I just searched the old boards and found the following solution:
address of reference: http://nwn2forums.bi...forum=114&sp=15
___________________________________
I got it working after doing the following:
7. Set the Master column for each of the new variants to the 2da value of the original spell.
8. Set the ConjAnim column of the original spell to **** (This one is probably optional).
9. Set the CastAnim column of the original spell to **** (This one is probably optional).
5 (Corrected). Alter the names of the child spell so players know which one they are casting: Set the hostile version's name value to 6423 and the neutral version's name value to 6423. (See below for more)
When I got to number 5 and tried to just change the numerical reference to a string, I got bad string refs and odd results. That column can only be a reference (could it be a string in nwn1?)
After digging into dialog.tlk for a bit using tlkedit, I realized that I'd need to create a whole new file and package that with the script. This seemed to be a road block for most people, because there's not a lot of information out there on how to even override the tlk, and also because I know there are some issues with it. Also, since this is the full language table for the whole game, and this doesn't seem like the more modular approach I wanted. There are other systems out there that use dialog.tlk, so I'd rather stay out of it.
So, instead I found the strings for "Hostile" and "Neutral" (6423 and 6424) and used those.
-=The end result=-
Now when you go to cast a Charm Person spell, two sub spells are presented: Hostile and Neutral. Clicking the hostile version will allow you charm hostiles as before and you still can't target neutrals. Clicking the neutral version won't let you target hostiles, but now you can target neutrals. Casting the spell from items allows you to choose each version if you right click on the item first.
-=Issues=-
The only side affects I see here are:
1. When the spell is cast, spellcraft checks say that a PC is casting "Hostile" or "Neutral" because that is now the actual name of the spell.
2. When cast from an item or a scroll, the hostile version is automatically picked. This may be something to do with the interface (I'll have to see what happens when you cast protection from alignment). Players will have to know to right click to get to the neutral version.
3. When you click on a spell, you are only presented with "Hostile" and "Neutral" and there is some minor loss of context.
-=Next Steps=-
I have to do this for the other variants before I can release it in the new version. Thoughts?
-=Additional Point=-
I should also mention what this means for installation. Basically, if you want to use the charm spells for PRR, you have to:
1. Import the PRR scripts.
2. Place the spells.2da in your campaign folder.
3. Set the spell hook variable to point to the prr_hook_charm script (or merge it with an existing spell hook script if you have one).
If you don't do 2 or 3, you'll get all the prr functionality, except for Charm spells. This seems like an elegant and modular path.
-------------------------------------------------------
I haven't tried it yet, but apparently it is possible.
address of reference: http://nwn2forums.bi...forum=114&sp=15
___________________________________
I got it working after doing the following:
7. Set the Master column for each of the new variants to the 2da value of the original spell.
8. Set the ConjAnim column of the original spell to **** (This one is probably optional).
9. Set the CastAnim column of the original spell to **** (This one is probably optional).
5 (Corrected). Alter the names of the child spell so players know which one they are casting: Set the hostile version's name value to 6423 and the neutral version's name value to 6423. (See below for more)
When I got to number 5 and tried to just change the numerical reference to a string, I got bad string refs and odd results. That column can only be a reference (could it be a string in nwn1?)
After digging into dialog.tlk for a bit using tlkedit, I realized that I'd need to create a whole new file and package that with the script. This seemed to be a road block for most people, because there's not a lot of information out there on how to even override the tlk, and also because I know there are some issues with it. Also, since this is the full language table for the whole game, and this doesn't seem like the more modular approach I wanted. There are other systems out there that use dialog.tlk, so I'd rather stay out of it.
So, instead I found the strings for "Hostile" and "Neutral" (6423 and 6424) and used those.
-=The end result=-
Now when you go to cast a Charm Person spell, two sub spells are presented: Hostile and Neutral. Clicking the hostile version will allow you charm hostiles as before and you still can't target neutrals. Clicking the neutral version won't let you target hostiles, but now you can target neutrals. Casting the spell from items allows you to choose each version if you right click on the item first.
-=Issues=-
The only side affects I see here are:
1. When the spell is cast, spellcraft checks say that a PC is casting "Hostile" or "Neutral" because that is now the actual name of the spell.
2. When cast from an item or a scroll, the hostile version is automatically picked. This may be something to do with the interface (I'll have to see what happens when you cast protection from alignment). Players will have to know to right click to get to the neutral version.
3. When you click on a spell, you are only presented with "Hostile" and "Neutral" and there is some minor loss of context.
-=Next Steps=-
I have to do this for the other variants before I can release it in the new version. Thoughts?
-=Additional Point=-
I should also mention what this means for installation. Basically, if you want to use the charm spells for PRR, you have to:
1. Import the PRR scripts.
2. Place the spells.2da in your campaign folder.
3. Set the spell hook variable to point to the prr_hook_charm script (or merge it with an existing spell hook script if you have one).
If you don't do 2 or 3, you'll get all the prr functionality, except for Charm spells. This seems like an elegant and modular path.
-------------------------------------------------------
I haven't tried it yet, but apparently it is possible.





Retour en haut






