Jump to content

Telekinesis spell problems


Caedwyr

Recommended Posts

For a telekinetic type spell I am working on, I had the following problem. I posted this over at TeamBG, but there is a problem Weidu may be able to solve, so I'm posting it here in the hopes that the local Weidu masters have some suggestions/solutions.

 

For a spell I'm working on, I'd like to be able to manipulate environmental objects through a spell at long distance. For example, I want to be able to activate the the "Use" icon that occurs over certain in game objects (Tilting the mirror in the Temple Ruins for example), open doors, close doors through this spell. Ideally, I would like to be able to cast the spell, and then click on the target at a distance, as though the PC was close enough to manipulate the environmental object even though they, or the caster is too far to be able to manipulate the environmental object.

 

 

Is this possible, and if so are there any hints I could have as to how this could be done?

 

 

I received this response from Galactygon.

 

It's possible, but it would require you a whole lot of work unless you figure something out, via WEIDU. Now don't ask me about WEIDU, because I know nothing yet.

 

Now, here's what I would do: Somehow make a new scriptingstate and apply it on your character. Let's name it STATE_TELEKINESIS

 

Now as for the triggers, you would transform things from these:

 

IF
Range(LastTrigger,5)
THEN
RESPONSE #100
   Do some stuff
END

IF
!Range(LastTrigger,5)
THEN
RESPONSE #100
   Display that you are too far from the trigger
END

 

 

 

.... To something like these:

 

 

  
IF
OR(2)
  Range(LastTrigger,5)
  CheckStat(LastTrigger,1,STATE_TELEKINESIS)
THEN
RESPONSE #100
   Do some stuff
END

IF
!Range(LastTrigger,5)
THEN
RESPONSE #100
   Display that you are too far from the trigger
END

 

 

 

As for doors and containers, you can maybe make an invisible/invulnerable creature that picks up everything in there/opens the door, and gives all the items to the caster. I believe there are more triggers in the IF part of the block, but I don't remember all of them. Someone might copy and paste an example.

 

Ok, so now I recognize that I'm going to have to alter some scripts. The question is, which scripts? Also, what I would Ideally like to implement is different ranges for the telekinetic effect depending on the level of the caster. So, for example a the level 1 version of the spell would have a range of 10 yards (RANGE: 20), the level 10 version of the spell would have a range of 100 (RANGE: 200).

 

Since the telekinesis spell will be an effect applied to the caster and it will have a duration, I can see how it can be scripted so that if the environmental trigger detects a certain spell effect on the caster, it can then check the range to see if that particular effect increases the reach of the caster far enough to trigger the switch. For example, some pseudo code:

 

IF
OR(2) 
   CheckStat(LastTrigger,1,STATE_TELEKINESIS20) //Level 1 version of the spell, has range of 20
     AND
     Range(LastTrigger,20)
   Range(LastTrigger,5)//The normal behaviour of the trigger
THEN
RESPONSE #100... //Trigger the switch

IF
!Range(LastTrigger,5)
THEN
RESPONSE #100
   Display that you are too far from the trigger
END

 

What I can see doing is creating multiple states/local variables that would be applied to the caster depending on what level of the spell they cast. These different states would be used in the pseudo code to vary the range of the spell.

 

The other thing I need this to do, is to open doors using a similar level dependant range system. I do not need this ability to pick up items.

 

A further complication, is that this spell will be castable by a summoned creature, not the pc, so that may introduce problems with switches and doors (I think that summons can't open doors or use switches).

 

 

So, how much work does this entail? Will I have to modify every single switch in the game or is there an easier way? The same question about doors. If every switch and door trigger will need to be modified, is there a way for Weidu to automate this to save time, and to automatically make the modifications to any new switches from new areas introduced by other mods that are range dependant?

 

Thanks for any help.

Link to comment

Okay, here goes. I can't guarantee this will work be here goes. As Galactygon said a stat check is probably be the way to go. I'd use the modify proficiency opcode on one of the unused proficiency to avoid clashing with Detectable Spells. You are going to have to modify every trigger script along these lines:

IF
 Clicked([ANYONE])
 Range(LastTrigger,5)
THEN
 RESPONSE #100
   Do some stuff.
END

IF
 Clicked([ANYONE])
 !Range(LastTrigger,5)
 CheckStat(LastTrigger,0,TELEKINESIS)
THEN
 RESPONSE #100
   Display ~You are too far away.~ string.
END

IF
 Clicked([ANYONE])
 Range(LastTrigger,20)
 CheckStat(LastTrigger,1,TELEKINESIS)
THEN
 RESPONSE #100
   Do some stuff.
END

IF
 Clicked([ANYONE])
 Range(LastTrigger,40)
 CheckStat(LastTrigger,2,TELEKINESIS)
THEN
 RESPONSE #100
   Do some stuff.
END

.
.
.

IF
 Clicked([ANYONE])
 Range(LastTrigger,800)
 CheckStat(LastTrigger,40,TELEKINESIS)
THEN
 RESPONSE #100
   Do some stuff.
END

This can be done with WeiDU using a REPLACE_BCS_BLOCK. Unfortunately every script will need to be alter individually as every one is different. As for which scripts, open up NI in a each area you will see a selection of "info, trigger or exit points" all the triggers will have a script, these are the ones you want to edit.

 

Now, doors. Doors can also have a script but most don't you will have to assign an appropriate script. This can be done with WeiDU. I think Clicked([ANYONE]) will work the same here. See lever1.bcs for scripting commands for doors. Hopefully the "Myself" object will work here you can then have a generic script for all doors.

 

If you still want to do this then I suggest you ignore the WeiDU coding for the time being and concentrate on getting the spell and scripts to work.

Link to comment

Ok, so it is doable then. If it is just a matter of large amounts of work, then that isn't really a problem; it'll just take a bit longer, but I am no stranger to grunt work (see the Anti-magic shell spell for evidence of this). My only concern is that my modifications will be incompatible with other mods. Is it possible to append the area scripts in a non-destructive manner that will ensure compatibility with most mods? The last thing I want is a repeat of my problems with the script hosing Druidic Sorcerer scripting changes.

Link to comment

It will be compatible, don't worry. Basically you REPLACE_BCS_BLOCK the ~You are too far away to use that.~ block with all the other blocks. (You could REPLACE_BCS_BLOCK with one block and then EXTEND_BOTTOM.) There may be incompatibility issues with specific mods (although I can't think of any WeiDU ones offhand), but they can be taken into consideration when the installer is made. It won't be compatible with the mods that add areas unless you make it compatible, by incompatible here I mean the spell simply won't work.

Link to comment
Guest The Ding0
This can be done with WeiDU using a REPLACE_BCS_BLOCK. Unfortunately every script will need to be alter individually as every one is different. As for which scripts, open up NI in a each area you will see a selection of "info, trigger or exit points" all the triggers will have a script, these are the ones you want to edit.

APPLY_BCS_PATCH might be easier, since I don't think you need to use entire blocks with that. I knew how to use it once, but found it largely useless so I can't really be of much more help now.

Link to comment

I've decided to postpone working on this portion of the Telekinesis spell for the time being. Since I'm making the spell for a summoned creature, and summons cannot normally open doors or activate switches, it wouldn't really make sense for them to be able to do so using a spell. Maybe next fall when I get off my summer job I'll work a bit further on this one to make it a fully useable spell by party members.

 

Thanks for all the help and suggestions. If/when I ever get around to doing this, they will be a great help.

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...