Aller au contenu

Photo

Targeting Neutral Creatures with Hostile Spells


  • Veuillez vous connecter pour répondre
18 réponses à ce sujet

#1
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I want to be able to cast hostile spells on neutral creatures. I tried changing the campaign selection which allows you to attack neutrals to "true" but it didn't work. 

Is there a master script that controls which creatures you can highlight with the cursor when you have selected a hostile spell?

I appreciate any help.

#2
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
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.

#3
MasterChanger

MasterChanger
  • Members
  • 686 messages
The person who wrote up that original bit you quoted wasn't terribly clear about what they're talking about. The central issue is the "TargetType" column of spells.2da: that tells you what your allowable targets are. The additional problem is that HostileSetting is a 0-or-1 value only, so you can target either hostiles or friendly/neutrals. (Look at the Wiki page for reference).

The process that the poster goes on to describe is how to create sub-radial spells/feats. Here's a thread where Kaedrin describes how to do those.

Theoretically, using sub-radials to give two options for HostileSetting is a workable solution. You can, if you want, use the same spell script for both spells. You'd then have to put in a GetSpellId() function call (check Wildshape for an example) to determine which version you used.

#4
0100010

0100010
  • Members
  • 87 messages
You also have to make a new version and new 2da row of each spell that you want to make capable of targeting both.

Here is an alternate trick you might want to play with:

http://nwn2forums.bi...92693&forum=114

Modifié par 0100010, 04 décembre 2010 - 07:56 .


#5
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Hey 0100010, thanks for that. It looks a little cleaner than trying to change spells which may interfere with Kaedrin's, which I want to integrate into the campaign. I looked over the post briefly and I think I understand the concept. I don't fully understand how to implement it yet, but I think that when I get to my modding computer and start putting things together it should work itsslef out. Thanks for the help.

#6
dethia

dethia
  • Members
  • 146 messages
I believe you just need to change target type in the 2da as has been suggested, I know we've set up various spells to target hostiles and the player himself, i would guess you can have a spell target hostiles and neutrals too.

#7
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
Hi Dethia,



Thanks for the advice and the interest. I don't know very much about altering 2da spell attributes. when I looked in the 2da files for the spells there didn't appear to be any settings which allowed a spell to target friendly and hostile creatures. It was an either-or scenario. Maybe there is a setting I am not aware of. If you know of one that would be immensely helpful and greatly apprecieated.

#8
The Fred

The Fred
  • Members
  • 2 516 messages
For charming, I've had the same problem, so I've settled on having it as an option in conversation. It's not ideal, but neither is the dual-spell solution, imo, and anyway I decided it was a bit much hassle ;-)

#9
The Fred

The Fred
  • Members
  • 2 516 messages
Actually, 0100010's link looks pretty interesting. It opens up a lot of possibilities, anyway...

#10
M. Rieder

M. Rieder
  • Members
  • 2 530 messages

The Fred wrote...

Actually, 0100010's link looks pretty interesting. It opens up a lot of possibilities, anyway...


Yes it does, for more things than just spells, I would imagine.

#11
The Fred

The Fred
  • Members
  • 2 516 messages
Indeed - for example, you might be able to make Auto-metamagic feats or items much more easily like this (possible otherwise but only through modifying basically all spellscripts), or at least that's what springs to mind, I expect there's a lot more that could be done too, including getting around the neutral/hostile targetting thing. Anyway, I digress...

#12
0100010

0100010
  • Members
  • 87 messages
Yes very much so, and I've known about it for a while, expect some interesting uses in Project M.

#13
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
So I am to the point in my module where I need to implement this method of targeting. I acutally need to use it to target a non-hostile object with a spell that can only be cast on the caster. Can that be done with this technique. I read through how to do it and it's out of my league. I really am having troubles making heads or tails of the mechanics of it.

#14
M. Rieder

M. Rieder
  • Members
  • 2 530 messages

M. Rieder wrote...

So I am to the point in my module where I need to implement this method of targeting. I acutally need to use it to target a non-hostile object with a spell that can only be cast on the caster. Can that be done with this technique. I read through how to do it and it's out of my league. I really am having troubles making heads or tails of the mechanics of it.


Okay, I'm working my way through it bit, by bit and reading some of the links and it is starting to unravel.  Wow!  This is amazing.  It really opens up the game to lots of new possiblities.  Thanks for sharing!

#15
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
0100010,

After taking a close look at the links you provided, it looks like I need to call the script which brings up the targeting GUI. The targeting GUI gets all the info from the currently targeted object and sends it to the script "gui_targetscript". From there, I can script whatever I want to happen to the object/location that the GUI targeted. Is that right?

Modifié par M. Rieder, 24 décembre 2010 - 02:15 .


#16
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I have the basic system running in a test module. I created an item that on activation will bring up the targeting cursor. When I click an object, the generic script that returns the object's type and position fires. Now I have to figure out how to use the system to allow the PC to target spells seamlessly.

#17
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
If you change the field "targettype" in "spells.2da" to 0x01, then as soon as you press the button in the quickcast bar for the modified spell, it automatically casts it on the caster without showing a cursor. This is the in that I need to make this work seamlessly. Tomorrow I am going to start changing the code for several spells and see how it works.

#18
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
I changed the code for "charm person" and used it to bring up a targeting cursor that could target both hostile and neutral creatures.

Modifié par M. Rieder, 26 décembre 2010 - 05:48 .


#19
M. Rieder

M. Rieder
  • Members
  • 2 530 messages
duplicate post

Modifié par M. Rieder, 26 décembre 2010 - 05:48 .