Jump to content


Photo

CastSpellOnMe


  • Please log in to reply
33 replies to this topic

#1 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 04 August 2016 - 02:56 AM

Hello!

 

How can I correctly detect that a specific spell has been cast on a creature by the same creature?

 

 

SpellCastOnMe(Myself,<ANYSPELL>)

 

 

 

does not seem to be working.

 

Thanks!
 



#2 Roxanne

Roxanne

    Modder

  • Member
  • 3564 posts

Posted 04 August 2016 - 03:12 AM

Hello!

 

How can I correctly detect that a specific spell has been cast on a creature by the same creature?

 

 

SpellCastOnMe(Myself,<ANYSPELL>)

 

 

 

does not seem to be working.

 

Thanks!
 

Either

SpellCastOnMe(Myself,CLERIC_CURE_LIGHT_WOUNDS) for spells in spell.ids

or

SpellCastOnMeRES("Spin109",Myself) for spellname.spl

 

I have never tried it for Object Myself, I have so far only used it for a specific NPC casting the spell using "scriptname".


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*

 


#3 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 04 August 2016 - 03:38 AM

Roxanne,

 

I did try the first solution but it did not work. :(


Edited by Salk, 04 August 2016 - 03:39 AM.


#4 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 04 August 2016 - 04:36 AM

What spell are we talking about ? It might enlighten us. For example, the Identify spell, isn't an actual spell... :P ..but more like an engine feature.
And effects aren't spells either... so if you want to detect them, you probably might need to make them cast spells on the character and thus ...

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#5 Roxanne

Roxanne

    Modder

  • Member
  • 3564 posts

Posted 04 August 2016 - 04:38 AM

Roxanne,

 

I did try the first solution but it did not work. :(

You may want to try [ANYONE] or Player1 instead of Myself. You may also look at this topic http://www.shsforums...er/#entry589177


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*

 


#6 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 04 August 2016 - 05:52 AM

Jarno,

 

I tried a couple of spells: WIZARD_ARMOR and WIZARD_INVISIBILITY.

 

SpellCast(Player1, WIZARD_INVISIBILITY) works, of course but I want the block to return true ONLY if the spell is cast on Player1.

 

Roxanne,

 

I tried using [ANYONE] and Player1... No luck.


Edited by Salk, 04 August 2016 - 05:54 AM.


#7 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 04 August 2016 - 06:04 AM

Well in that case you probably need to use detectable spells/stats. Aka detect your spells with unused proficiency markers, or what ever the thing ever does, that's what the enemy expects you to do too, if for example you have SCS or BP AI installed. Aka the thing is the same for all the mods, installed via a easy .tph file that's included in the archive.
Roxanne, I did try the first solution but it did not work. :(
Did you realize that the:
SpellCastOnMe(Myself,WIZARD_INVISIBILITY)
Trigger is only true if the spell is being casted ... so if the character is already invisible, it's not true anymore... as far as I know.

Edited by The Imp, 04 August 2016 - 06:11 AM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#8 Roxanne

Roxanne

    Modder

  • Member
  • 3564 posts

Posted 04 August 2016 - 06:54 AM

Jarno,

 

I tried a couple of spells: WIZARD_ARMOR and WIZARD_INVISIBILITY.

 

SpellCast(Player1, WIZARD_INVISIBILITY) works, of course but I want the block to return true ONLY if the spell is cast on Player1.

 

Roxanne,

 

I tried using [ANYONE] and Player1... No luck.

Probably the issue is the selection of spells - it works for the type of spells that a caster (wizard or priest) is supposed to cast on another creature, it may not work for so-called spells that modify, alter abilities, states or such. (Like Imp says, there is a large variety of what spl can do in the game). My experience is that the beginning of the casting (the caster starts to wield his hands...) triggers the action, even if the spell takes more than a round to actually have effect.


The Sandrah Saga

another piece of *buggy, cheesy, unbalanced junk*

 


#9 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 04 August 2016 - 07:40 AM

Well, I thought there was an easy way to do this but it seems not.

Let's see if someone has other inputs otherwise I will drop it, thanks for your help though.

Cheers!
Did you realize that the:
SpellCastOnMe(Myself,WIZARD_INVISIBILITY)
Trigger is only true if the spell is being casted ... so if the character is already invisible, it's not true anymore... as far as I know.
 


 
Yes, when I tested that above the caster was not invisible.

Edited by Salk, 04 August 2016 - 07:42 AM.


#10 Argent77

Argent77
  • Administrator
  • 1397 posts

Posted 04 August 2016 - 09:26 AM

In my test the script triggered successfully using the condition "SpellCastOnMe(Myself, WIZARD_BLUR)". Tested on BG2:EE.

Just to make sure, did you add the script block to a creature script of Charname (e.g. dplayer3.bcs)? In this case you may have to enable Party AI to see any results.
 



#11 Salk

Salk
  • Modder
  • 1411 posts

Donator

Posted 04 August 2016 - 07:58 PM

Argent77,

 

thanks for testing it in your game.

 

I have the block in the Familiar script. What I tested was this (BGT):

 

TriggerOverride(Player1, SpellCastOnMe(Myself, WIZARD_INVISIBILITY))

 

and when CHARNAME casts Invisibility the trigger does not seem to fire. I have not actually directly tried SpellCastOnMe(Myself, WIZARD_INVISIBILITY) from dplayer3.bcs.

 

I will try and do other testing.


Edited by Salk, 04 August 2016 - 08:02 PM.


#12 psycros

psycros
  • Member
  • 57 posts

Posted 26 August 2016 - 03:17 AM

So here I am, nearly five months after discovering BG:EE...and still no real progress on modding.  BGEE 2.x is a non-starter due to Beamdog's idiotic rollback of key mappings to Original Trilogy standards.  I even tried the GoG version of BGEE 2.x with Modmerge but all that does is make the game crash on startup if I install so much as a single mod. So I have a simple request that I hope the lords of BWS or whoever will consider: If it's not too much trouble could someone post the last stable release of BWS for v1.3 EEs someplace?  At least then I might have a chance of finally enjoying a modded game and not have to be constantly mousing around.  Thanks to anyone who can help.



#13 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 26 August 2016 - 03:40 AM

So here I am, nearly five months after discovering BG:EE...and still no real progress on modding.  BGEE 2.x is a non-starter due to Beamdog's idiotic rollback of key mappings to Original Trilogy standards.
Sorry, but what are you talking about, there's no such thing as Original Trilogy let alone a standard it would set... keymapping can be changed, you just need to edit the correct .lua file(usually L_en_US.lua ) in your game files(with Near Infinity snapshot Argent77 has been up keeping).
You could make a post about the crash in the Modmerger's own thread if the crash is so bad.

There is measurable differences between now and 5 months ago on other parts... so it's only you that didn't move, or know what the movement was.

Edited by The Imp, 26 August 2016 - 03:53 AM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#14 psycros

psycros
  • Member
  • 57 posts

Posted 26 August 2016 - 10:23 PM

So here I am, nearly five months after discovering BG:EE...and still no real progress on modding.  BGEE 2.x is a non-starter due to Beamdog's idiotic rollback of key mappings to Original Trilogy standards.
Sorry, but what are you talking about, there's no such thing as Original Trilogy let alone a standard it would set... keymapping can be changed, you just need to edit the correct .lua file(usually L_en_US.lua ) in your game files(with Near Infinity snapshot Argent77 has been up keeping).
You could make a post about the crash in the Modmerger's own thread if the crash is so bad.

There is measurable differences between now and 5 months ago on other parts... so it's only you that didn't move, or know what the movement was.

 

When I say Original Trilogy what I meant was BG, BG2 and ToB...sorry, I guess that didn't make much sense, actually.

 

I attempted the LUA editing and it made no difference at all.  Have you actually tried it?  I still have no idea about Near Infinity or "snapshots"..I've found no information on this.  I'm betting someone has a copy of the old BWS someplace and it would probably not be a big deal for them to make it available to those who still want to use a large variety of classic mods.  We all know that Beamdog broke modding almost completely in 2.x, although solid info on what progress is actually being made seems hard to come by.  While I'm not positive what you mean about "measurable differences" it sounds like you're saying exactly what I'm saying - that most of us are in the dark about which mods are actually working well under BGEE 2.x.  It was pure luck that I even found this forum!  In the meantime it would be nice if we could just play the old 1.3 version with an old copy of BWS.



#15 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 27 August 2016 - 05:35 AM

I still have no idea about Near Infinity or "snapshots"..I've found no information on this. 

Here read all about it. If you don't know about the mod making tools you have available, no wonder you have no progress... a bother to search is a bother worth taking, all you had to do was to google site search this site  for the word "Near Infinity", go and make one and see if you do not believe. It should be the first link it gives.

If you haven't used that, then what are you even using to try to make progress ?

 

And for your information, the Beamdog didn't break the moding in v2.x, that's only the opinion of ALIEN. The main maintainer of the BWS.

They have 3 upfits that distribute the game, Steam, GoG and their own site. Each have their own set standards. It's not really only up to Beamdog. And for your information, the things that the game now has ability to be edited is a rather large portion of previously completely internalized code that we couldn't edit because we do not have a source code access. Which is up to Beamdog. In broad sense as they edit the files, and can externalize things that the original engine didn't allow. But the two are not the exact same thing as not even the Beamdog had access to the original games source code. It's an approximation of the original. Simulation of a simulation. A rabbit hole.

 

Now of course you need to have every of those versions to be able to verify that setting something in BWS to fit into one doesn't break everything in the other cases. ALIEN doesn't have access to everyone of them, so he is unable to overhaul the install process to work in all of them. And it's likely going to take a lot of work too. As the EET is not as simple as install one mod on top of everything else(like the BGT-weidu was not either, but it was the base the BWP and so BWS was build on) and it's still in Research Candidate state. RC5 at the moment.

Breaking something such as the BWS is easy, you just have to add one mod to the game .. and that's it. And the EE games v2.x is new. It doesn't break the things that were there before the EE games, Aka the non EE based BWS games. In case you failed to notice.

 

Progress you ask. Well, all I had to do to find what to edit to fix your keybounding issue you have was to fire up an up to date game editor(aka a snapshot version of the Near Infinity) and search for the word "key" in it. It gave a list of files that contained the word, and words, one that was something related to keybounding and there your answer lies. I know it's the right file, because other games have files that have a similar structure to that one.

And by the by, you can't access to the .lua files the game has without a game editor that has access to it as the original file is located in a .bif file... a file that is made from other files for this particular engine, to make them more easily readable by the games engine. Cause it was originally a multi-CD based and thus playable in the old computers.


Edited by The Imp, 27 August 2016 - 05:45 AM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#16 psycros

psycros
  • Member
  • 57 posts

Posted 27 August 2016 - 08:04 PM

I still have no idea about Near Infinity or "snapshots"..I've found no information on this. 

Here read all about it. If you don't know about the mod making tools you have available, no wonder you have no progress... a bother to search is a bother worth taking, all you had to do was to google site search this site  for the word "Near Infinity", go and make one and see if you do not believe. It should be the first link it gives.

If you haven't used that, then what are you even using to try to make progress ?

 

And for your information, the Beamdog didn't break the moding in v2.x, that's only the opinion of ALIEN. The main maintainer of the BWS.

They have 3 upfits that distribute the game, Steam, GoG and their own site. Each have their own set standards. It's not really only up to Beamdog. And for your information, the things that the game now has ability to be edited is a rather large portion of previously completely internalized code that we couldn't edit because we do not have a source code access. Which is up to Beamdog. In broad sense as they edit the files, and can externalize things that the original engine didn't allow. But the two are not the exact same thing as not even the Beamdog had access to the original games source code. It's an approximation of the original. Simulation of a simulation. A rabbit hole.

 

Now of course you need to have every of those versions to be able to verify that setting something in BWS to fit into one doesn't break everything in the other cases. ALIEN doesn't have access to everyone of them, so he is unable to overhaul the install process to work in all of them. And it's likely going to take a lot of work too. As the EET is not as simple as install one mod on top of everything else(like the BGT-weidu was not either, but it was the base the BWP and so BWS was build on) and it's still in Research Candidate state. RC5 at the moment.

Breaking something such as the BWS is easy, you just have to add one mod to the game .. and that's it. And the EE games v2.x is new. It doesn't break the things that were there before the EE games, Aka the non EE based BWS games. In case you failed to notice.

 

Progress you ask. Well, all I had to do to find what to edit to fix your keybounding issue you have was to fire up an up to date game editor(aka a snapshot version of the Near Infinity) and search for the word "key" in it. It gave a list of files that contained the word, and words, one that was something related to keybounding and there your answer lies. I know it's the right file, because other games have files that have a similar structure to that one.

And by the by, you can't access to the .lua files the game has without a game editor that has access to it as the original file is located in a .bif file... a file that is made from other files for this particular engine, to make them more easily readable by the games engine. Cause it was originally a multi-CD based and thus playable in the old computers.

 

Sorry, but from everything I have read Beamdog is almost totally responsible for the modding problems.  They could have easily taken distributor customizations into account without needing source code or anything like that, so I'm afraid you're virtually alone in your opinion on this.  I also hope that you're not suggesting the keymapping issue is my problem to solve, because it worked perfectly in BGEE 1.3 and now it doesn't.  That's 100% Beamdog's blunder and, frankly, its inexcusable.  Hence my desire to get a copy of BWS for v.1.3, hopefully with the proper mod versions already in the download folder.  I'm tired of waiting for Beamdog to fix its mistakes and I just want to play a modded game.  Also, I wasn't 100% sure what you meant by this:

 

"And the EE games v2.x is new. It doesn't break the things that were there before the EE games, Aka the non EE based BWS games. In case you failed to notice."

 

Are you saying that mods that worked fine with the classic Baldur's Gate versions (pre-EE) also work in the Enhanced Editions?  If so, that's the first time I've heard it.  In fact, what I've read everywhere else is that when the EEs came out nearly every major mod needed some minor updating.  Since it didn't require much work, most of the modders took the time to do it.  With the change from 1.3 to 2.x I have read that there is more effort required to update mods so its taking longer.  On the bright side, its also sounds like Infinity Engine mods can do new things under 2.x, but with such an old game you have to wonder how many modders will take advantage of this.

 

With that all said, I do really appreciate the information you've provided.  It's definitely stuff that I've needed to know about.  I've said it before: I am a long time game mod user, but am not a modder myself.  I've picked up quite a bit of knowledge regarding how most mods work, but that doesn't make me a programmer.  Please understand that most people who mod their games are not into coding of any kind (this seems to be a fact that the modding community often doesn't appreciate).  I didn't realize you needed a special tool to edit LUAs in IE games.  I think I used some freeware programming notepad to do it..I never once saw anything about Near Infinity or other modding tools when I was doing searches.  Perhaps that's why I didn't see any difference from my changes :doh:   Most of us have no interest in modifying other people's mods, let alone creating our own.  I have actually spent what probably amounts to a few months of my life hacking mods for various games, troubleshooting compatibility and all the rest of it.  I just don't have the time or patience for it any more.  I just want to use mods in my games - and that's why tools like BWS are of such importance to people like myself.  We really just want as few problems as possible when installing and using mods.  Ideally every game would have a mod manager that's maintained by experienced people in the community - people who've already overcome most of the common problems in getting mods to work together.

 

Another minor observation: I just installed the GoG release of BGEE 2.x and patched it to v.2.3.67.3.  It only has one LUA file in the whole folder tree (Engine.lua).  I know that under v1.3 there were several more uncompressed LUAs.  I can only assume that while more of the code in 2.x has been externalized, Beamdog must have moved those missing LUAS into a compressed resource package.  BTW, I intend to try Near Infinity and see if I can make any headway with keymapping.  If I can at least accomplish that much then I might be tempted to experiment more with BGEE installs and BWS.



#17 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 27 August 2016 - 09:44 PM

Uuh, have you tried starting the game, and then go to Options -> Gameplay -> Assign Keys ... ?

Yeah, it's not in the ... .lua files.


Edited by The Imp, 27 August 2016 - 09:49 PM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.


#18 psycros

psycros
  • Member
  • 57 posts

Posted 28 August 2016 - 06:16 PM

Uuh, have you tried starting the game, and then go to Options -> Gameplay -> Assign Keys ... ?

Yeah, it's not in the ... .lua files.

 

You can't be serious.

 

At this point I can't tell if you're trolling or just having trouble with English.



#19 subtledoctor

subtledoctor
  • Modder
  • 656 posts

Posted 31 August 2016 - 08:57 PM

Not sure what you're talking about with "Beamdog broke modding." You need to use ModMerge on the GOG/Steam games in order for mods to work with the ether dialog.tlk... but that's easy. A few mods needed slight updates to work with 2.0, but those updates have all happened. Pretty much everything is working fine - off the top of my head I can't think of a mod that works on 1.3 but not 2.0. Maybe little stuff like that one-off Duskblade mod...

Plus, 2.0 actually has a bunch of great stuff for modders. Several mods are being worked on that will *require* 2.0 or later (including mine ;) )

#20 The Imp

The Imp

    Not good, see EVIL is better. You'll LIVE.

  • Member
  • 5150 posts

Posted 01 September 2016 - 01:55 AM

Not sure what you're talking about with "Beamdog broke modding."

It's a quote of what ALIEN put into the BWS to say when you try to use the BWS in v2.x EE game. And the game cannot be modified (due to it not having the ModMerger install... yeah, it's not a weidu mod)

He hasn't had the time to make the effort to make the ModMerger a weidu mod & get it so every one that uses the BWS could use it ... CAUSE IT*S NOT HIS MOD. And the BeamDog hasn't taken the responsible thing to do and made it available in an official announcement and capacity or in a EE update, probably cause it's not what they do. That's where we stand at, at that. I have stated this previously too, but you... But you forgot cause you disagree-ed with how it should be handled ?

And your dreamed fact that the weidu.exe would be capable of handling .zip files in the DLC folder hasn't happened, and is likely to not to in any time soon. Why, cause it's a .zip archive... in any other cause the OSes(Windows, OS X, Android, Linux etc) would be using .zip files, and be fine with those instead of what ever they use now, why cause they would take less space... than their non converted source coded material(aka the actual files that make up the .zip's content).


Edited by The Imp, 01 September 2016 - 02:20 AM.

Yep, Jarno Mikkola. my Mega Mod FAQ. Use of the BWS, and how to use it(scroll down that post a bit). 
OK, desert dweller, welcome to the sanity, you are free to search for the limit, it's out there, we drew it in the sand. Ouh, actually it was still snow then.. but anyways.