Author Topic: Proper place to run a script  (Read 3398 times)

Offline magilvia

  • Planewalker
  • *****
  • Posts: 8
Proper place to run a script
« on: February 14, 2005, 04:58:10 PM »
I'm quite new to scripting and I would like to create a mage kit which requires to use scripts often. The problem is I can't find a proper place to run the script because:
- I can't use baldur.bcs because HaveSpell() or RemoveSpell() wouldn't work
- for the same reason I can't use the invisible creature trick.
- I wouldn't like to use dplayer3.bcs because it's deactivated when AI is turned off and my kit would lose all ability
- for the same reason I can't use ChangeAIScript with level >= CLASS
- I fear I would mess something if I use ChangeAIScript with level < CLASS

There's no other place to run script, isn't it ?
I don't understand why in IE  does not exist a default, ever active, mandatory script for PCs and/or NPCs. It's seem such a obvious feature...  :(

Thanks.

Offline Loriel

  • Planewalker
  • *****
  • Posts: 390
  • Gender: Male
    • Loriel's Downloads
Re: Proper place to run a script
« Reply #1 on: February 14, 2005, 08:30:57 PM »
You can run the script in the OVERRIDE slot of the CRE.  It is not deactivated by turning off the AI, and it has the highest priority when the AI is turned on.  If you need to change scripts often, you can still use ChangeAIScript() to assign to the OVERRIDE slot.

Offline magilvia

  • Planewalker
  • *****
  • Posts: 8
Re: Proper place to run a script
« Reply #2 on: February 15, 2005, 06:34:41 AM »
Which creature do you mean? I need my script to run on party members but I fear to mess something using their override script. is it correct ?

Offline Loriel

  • Planewalker
  • *****
  • Posts: 390
  • Gender: Male
    • Loriel's Downloads
Re: Proper place to run a script
« Reply #3 on: February 15, 2005, 07:09:49 AM »
I misunderstood.  I thought you meant you were creating a new NPC with that kit.  If the kit is supposed to run on an existing NPC, then putting it in the OVERRIDE slot on that NPC would probably be a bad idea (since that's where romances/personal quests/etc are taken care of for each NPC).  The unfortunate thing is, that's the only slot on a CRE that is not deactivated by turning off the AI.

Offline magilvia

  • Planewalker
  • *****
  • Posts: 8
Re: Proper place to run a script
« Reply #4 on: February 15, 2005, 12:16:06 PM »
What about the override script for the PC ?

Offline Loriel

  • Planewalker
  • *****
  • Posts: 390
  • Gender: Male
    • Loriel's Downloads
Re: Proper place to run a script
« Reply #5 on: February 15, 2005, 03:05:17 PM »
It's open in the unmodded game, although some mods might actually use it.  I couldn't point you to a list of mods that do, though.

Offline magilvia

  • Planewalker
  • *****
  • Posts: 8
Re: Proper place to run a script
« Reply #6 on: February 15, 2005, 03:40:49 PM »
If it's not too much trouble. Thank you.
Is there a way to check if an override script has been assigned, or better a way to restore a previously assigned script ?

Offline Rabain

  • Planewalker
  • *****
  • Posts: 281
  • Gender: Male
  • Luck o' the Irish!
Re: Proper place to run a script
« Reply #7 on: February 15, 2005, 04:08:09 PM »
Why does this script need to be on joinable NPC'S?

What about using EXTEND to add your script code into whatever script is in the override of each known joinable NPC?  This would take 2 minutes to find out in NI.

I don't get what you are trying to do though, if the script is for a kit why does it need to be assigned to each NPC, are you planning on making them all use the same kit?

Maybe if you explain a bit further what you want this script to do there might be an easier way of doing things already known to someone!
Touchstone: Wild Elf Fighter
BG2CPM: Dialog Portraits for Everyone!
WTPFamiliars: A new version of the Find Familiar Spell
All at: Border Kingdoms

Offline igi

  • IESDP Guardian
  • Planewalker
  • *****
  • Posts: 124
  • IESDP Guardian
Re: Proper place to run a script
« Reply #8 on: February 16, 2005, 02:45:05 PM »
I believe the normal practice is just to bung it in dplayer, and advise players not to disable party AI.
NPC: Arg || Galoomp || Thash
Mods: Dark Heart of the Xvart || GbG
Tweak Pack: iiTweak

mcwrench.com
mcwrench.com forums

Offline magilvia

  • Planewalker
  • *****
  • Posts: 8
Re: Proper place to run a script
« Reply #9 on: February 16, 2005, 04:47:30 PM »
Why does this script need to be on joinable NPC'S?

What about using EXTEND to add your script code into whatever script is in the override of each known joinable NPC? This would take 2 minutes to find out in NI.

I don't get what you are trying to do though, if the script is for a kit why does it need to be assigned to each NPC, are you planning on making them all use the same kit?

Maybe if you explain a bit further what you want this script to do there might be an easier way of doing things already known to someone!
I'll explain better. I would like to change the spellcasting system in BG2. This is primarily for my personal use with my PC. Since I'm working on it I think it could take a little effort to  create a new kit and release it as a mod. I think that it could possible interest other players too. But why should I limit the system to work on the PC ? It could be interesting to make other party member mages use the same system, too. And since it is an alternative spellcasting system players should not be able to disable it "just for a while" turning AI off. It will be like cheating... Hence my question.
In particular with my system Mages can regain spells after a certain amount of time without sleep but they're not granted to regain a spell after only 8 hours of sleep. (this is teory. For now I would content myself to find the proper place to run the system scripts.)

The only alternative spellcasting system I found is the mana system from DLTC  but it doesn't even work.

What do you mean with EXTEND ? Is it a function of weidu ? I didn't have time to look through it by now.

Offline magilvia

  • Planewalker
  • *****
  • Posts: 8
Re: Proper place to run a script
« Reply #10 on: February 18, 2005, 12:55:28 PM »
So should I assume there's no solution?

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Proper place to run a script
« Reply #11 on: February 18, 2005, 03:52:22 PM »
Could do as DLTC does and edit the keymap.ini to not have an AI on/off switch, and edit the GUI to not have the AI on/off button.  That way AI would be on all the time.
Earn Money Sleeping.

Offline Rabain

  • Planewalker
  • *****
  • Posts: 281
  • Gender: Male
  • Luck o' the Irish!
Re: Proper place to run a script
« Reply #12 on: February 18, 2005, 04:04:25 PM »
Quote
What do you mean with EXTEND ? Is it a function of weidu ? I didn't have time to look through it by now.

Yes it is a function of weidu that allows you to add some script code that you have written to an existing script while keeping what already exists in the script intact.

In this case all you would need to do is have the script you create assigned to whichever npc is using your kit.  As it is a mage kit you would only need to find the scripts that are used by the mage npc's in the game and EXTEND them with your new code or replace should you feel it necessary.

Touchstone: Wild Elf Fighter
BG2CPM: Dialog Portraits for Everyone!
WTPFamiliars: A new version of the Find Familiar Spell
All at: Border Kingdoms

Offline SimDing0™

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: Proper place to run a script
« Reply #13 on: February 18, 2005, 06:33:27 PM »
The only alternative spellcasting system I found is the mana system from DLTC but it doesn't even work.
You could probably download and look at the DLTC demo to see it actually working properly. Porting it back to BG2 wasn't Max's top priority.

Offline magilvia

  • Planewalker
  • *****
  • Posts: 8
Re: Proper place to run a script
« Reply #14 on: February 19, 2005, 08:17:17 AM »
Quote
Could do as DLTC does and edit the keymap.ini to not have an AI on/off switch, and edit the GUI to not have the AI on/off button.  That way AI would be on all the time.
Thanks I'll think on this.
Since we are talking of the GUI, is it possible to exchange the "load" button with the "new game" button during the first menu screen after "single player" / "multiplayer" choice ? I ask this because when one clicks "single player" the mouse pointer is over the "new game" button so one has to remember to move the mouse to the right over the "load" button 99.9% of times. It's just another little annoing think that black isle should have take care of.
Quote
Yes it is a function of weidu that allows you to add some script code that you have written to an existing script while keeping what already exists in the script intact.
OK i'll use it, thanks.
Quote
You could probably download and look at the DLTC demo to see it actually working properly. Porting it back to BG2 wasn't Max's top priority.
Yes, I looked through Max BG2 porting mana scripts. He actually override the GENERAL script with ChangeAIScript. I would have liked to try something different as alredy explained.


Offline Loriel

  • Planewalker
  • *****
  • Posts: 390
  • Gender: Male
    • Loriel's Downloads
Re: Proper place to run a script
« Reply #15 on: February 19, 2005, 10:27:16 PM »
Yes, I looked through Max BG2 porting mana scripts. He actually override the GENERAL script with ChangeAIScript. I would have liked to try something different as alredy explained.

But with the AI always on, as described above, the GENERAL script slot (or indeed any script slot) would work just fine.  Basically, the only way to make a kit dependent on scripts would be to either use the OVERRIDE slot, use the DPLAYER* scripts and tell people not to disable the AI (and not worry about whether they decide to cheat), or to disable the AI-disabling features and use whatever script slot you want.  None are ideal, but unless someone can think of another alternative, they might be your only options.

Offline Rabain

  • Planewalker
  • *****
  • Posts: 281
  • Gender: Male
  • Luck o' the Irish!
Re: Proper place to run a script
« Reply #16 on: February 20, 2005, 03:52:35 AM »
What about baldur.bcs, thats always running right?

Though its generally advised not to overuse this script for some reason!
Touchstone: Wild Elf Fighter
BG2CPM: Dialog Portraits for Everyone!
WTPFamiliars: A new version of the Find Familiar Spell
All at: Border Kingdoms

Offline magilvia

  • Planewalker
  • *****
  • Posts: 8
Re: Proper place to run a script
« Reply #17 on: February 20, 2005, 09:05:05 AM »
Quote
But with the AI always on, as described above, the GENERAL script slot (or indeed any script slot) would work just fine.  Basically, the only way to make a kit dependent on scripts would be to either use the OVERRIDE slot, use the DPLAYER* scripts and tell people not to disable the AI (and not worry about whether they decide to cheat), or to disable the AI-disabling features and use whatever script slot you want.  None are ideal, but unless someone can think of another alternative, they might be your only options.
Ok thanks for your suggestions.

Quote
What about baldur.bcs, thats always running right?
As said above some action and triggers won't work in baldur.bcs such as havespell() and removespell()

Offline Rabain

  • Planewalker
  • *****
  • Posts: 281
  • Gender: Male
  • Luck o' the Irish!
Re: Proper place to run a script
« Reply #18 on: February 20, 2005, 04:39:48 PM »
Is it possible to call a script from a script?

In the way the dialogue fix patch on some npc's work? Pressing a hotkey calls a script which starts a cutscene that is anther script. Is there a way to do this withou using cutscene perhaps?
Touchstone: Wild Elf Fighter
BG2CPM: Dialog Portraits for Everyone!
WTPFamiliars: A new version of the Find Familiar Spell
All at: Border Kingdoms

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Proper place to run a script
« Reply #19 on: February 20, 2005, 07:32:40 PM »
You could do:

IF
  HotKey(whatever)
THEN
  RESPONSE #100
    StartCutSceneMode()
    StartCutScene("blah")
END

This is, as I recall, how the PKers in multi-player used to do their stuff.  Anyone remember that?  The days when TeamBG was so righteously outraged at hackers and the like that they had that huge campaign against it?  And how the hackers were all... well, I forget their opinion.  The situation was quite laughable at any rate.  Every so often someone would come through the scripting help forum asking for help with their (obvious) multi-player PK script, and the capital letters and exclamation marks would soon follow.  So cool.

Anyways, you could also use other methods.

...
  RESPONSE #100
    ActionOverride(Player1,ChangeAIScript("blah",DEFAULT)
END
Earn Money Sleeping.

Offline Avenger_teambg

  • Planewalker
  • *****
  • Posts: 399
Re: Proper place to run a script
« Reply #20 on: February 21, 2005, 12:38:28 PM »
Nah, teambg was outraged because pk scriptors took away the bandwith from those cute npc modders :)

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: Proper place to run a script
« Reply #21 on: February 21, 2005, 06:00:27 PM »
Yeah, good thing they had that quiz, then.

1) Are you making an NPC mod?
Y/N?
2) Are you going to use these tools to cheat?
Y/N?

If you answer yes to any of these questions, you will be banned forever.  Have a nifty day.
Earn Money Sleeping.

Offline SimDing0™

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: Proper place to run a script
« Reply #22 on: February 22, 2005, 02:38:39 AM »
Haha, the quiz was amazing.

Offline igi

  • IESDP Guardian
  • Planewalker
  • *****
  • Posts: 124
  • IESDP Guardian
Re: Proper place to run a script
« Reply #23 on: February 22, 2005, 12:56:34 PM »
That quiz sounds pretty neat.
Except the second question, thats dumb.
But if we screened people on the first question...
NPC: Arg || Galoomp || Thash
Mods: Dark Heart of the Xvart || GbG
Tweak Pack: iiTweak

mcwrench.com
mcwrench.com forums

Offline SimDing0™

  • Back In Black
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 3496
  • Gender: Male
  • Word Enhancer
Re: Proper place to run a script
« Reply #24 on: February 22, 2005, 01:29:38 PM »
I thought the actual TeamBG quiz was better. Maybe PPG should do a similar one.

WHAT ARE PEE PEE'S GOALS?
1) PRODUCING QUALITY INFINITY ENGINE MODS
2) MOCKING PEOPLE
3) PORN
4) ALL OF THE ABOVE

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: