Jump to content


Photo

LevelParty


  • Please log in to reply
9 replies to this topic

#1 melkor_morgoth75

melkor_morgoth75

    Lord

  • Modder
  • 1509 posts

Posted 19 August 2008 - 10:35 PM

Hi all,

i'd like to use LevelParty to run some scripts for a spawn system.

Here is an example:

IF
  Range([PC],35)
  TimeOfDay(DAY)
  NumInParty(1)
  LevelParty(1)
  ...
  ...
THEN
  RESPONSE #50
  ...
  CreateCreature("BEARBL",[x.y],0) // Black Bear
  ...

So if i have only 1 Char in the party and it he/she is LEV=1 in certain condition it would spawn a black bear.

Now ... i'd also like to check/implement 2 different things. If the HIGHEST Character in the party is equal to "x" or "y" and also if the HIGHEST Character in the party is greater than "z".
First question ... does LevelParty check the character with highest level? If yes, i tried this but it seems it doesn't work as intended:

(here i want to trigger-> create a Wild Dog, if the highest levelled char is at 4 or 5 (NumInParty is 5 but could be 1 to 6))
IF
  Range([PC],35)
  TimeOfDay(DAY)
  NumInParty(5)
  OR(2)
  LevelParty(4)
  LevelParty(5)
  ...
  ...
THEN
  RESPONSE #10
	...
	CreateCreature("DOGWI",[x.y],0) // Wild Dog
	...
	...

It seems it doesn't work as intended .... here i think i'm at the beginning of modding and i did something wrong ...

(here i want to trigger-> create a Wild Dog, if the highest levelled char is greater than 7)
IF
  Range([PC],35)
  TimeOfDay(DAY)
  NumInParty(3)
  LevelPartyGT(7)
  ...
  ...
THEN
  RESPONSE #8
	...
	CreateCreature("DOGWI",[x.y],0) // Wild Dog
	...
	...

In the case above i noticed that it ONLY works if i ALSO use LevelPartyLT so for example:
LevelPartyGT(7)
LevelPartyLT(K)

Am i forced to use BOTH GT and LT triggers if i want to check for a character Lev greater than x?

Many thanks in advance guys :cheers:

mm75

Edited by melkor_morgoth75, 19 August 2008 - 10:36 PM.

Tired of the same boring spawned creatures u face in BG? Try BGSpawn


#2 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 20 August 2008 - 01:56 PM

So you've decided to enter the dirty world of modding, eh? My advice to you is *don't do it*! :crying:

But anyway...

If the HIGHEST Character in the party is equal to "x" or "y" and also if the HIGHEST Character in the party is greater than "z". First question ... does LevelParty check the character with highest level? If yes, i tried this but it seems it doesn't work as intended:

This trigger is not tested (NT in the IESDP), so I don't know if anyone's had a whole lot of experience with it. I assume you tested it with a RESPONSE #100 and nothing else but your desired result in the action block?

Am i forced to use BOTH GT and LT triggers if i want to check for a character Lev greater than x?

Dunno, but this isn't a bad thing really, and how I would code it anyway, since you can then target certain ranges (even if the range only includes one level).

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#3 melkor_morgoth75

melkor_morgoth75

    Lord

  • Modder
  • 1509 posts

Posted 20 August 2008 - 10:13 PM

So you've decided to enter the dirty world of modding, eh? My advice to you is *don't do it*! :crying:

But anyway...

If the HIGHEST Character in the party is equal to "x" or "y" and also if the HIGHEST Character in the party is greater than "z". First question ... does LevelParty check the character with highest level? If yes, i tried this but it seems it doesn't work as intended:

This trigger is not tested (NT in the IESDP), so I don't know if anyone's had a whole lot of experience with it. I assume you tested it with a RESPONSE #100 and nothing else but your desired result in the action block?

Am i forced to use BOTH GT and LT triggers if i want to check for a character Lev greater than x?

Dunno, but this isn't a bad thing really, and how I would code it anyway, since you can then target certain ranges (even if the range only includes one level).


Yep, finally i did enter the world .. but i'm cautious :whistling:

Currently i'm working on a new spawn system for BGT ... somewhat based on tutu-levelled spawn used but BGT-Tweaks currently, but much more deeper and ... complicated (it takes 1 week to only write a table for a single area...).

Anyway, RL permitting ... i'm here bothering all of you with my issues :cheers:

Yep, currently i can state that it's NOT ENOUGH to use ONLY LevelPartyGT, u NEED also to use LT and set a range, it won't trigger if not. I'm also trying to discover how to work with only couple of level checks because it seems the code above doesn't work as well.

Back here with results eventually,

thanks!

mm75

Edited by melkor_morgoth75, 20 August 2008 - 10:26 PM.

Tired of the same boring spawned creatures u face in BG? Try BGSpawn


#4 melkor_morgoth75

melkor_morgoth75

    Lord

  • Modder
  • 1509 posts

Posted 25 August 2008 - 05:13 AM

Unfortunately LevelParty doesn't work as intended. It doesn't return the highest levelled character :-(

I tried multiple times and it doesn't work, so it seems i'm forced to base all my system on main character's level (so i will check Level(Player1)). Has anyone discovered such bug in that trigger before?

mm75

Tired of the same boring spawned creatures u face in BG? Try BGSpawn


#5 Ascension64

Ascension64
  • Modder
  • 5983 posts

Posted 26 August 2008 - 02:02 AM

So it checks the level of the main character only?

--------------
Retired Modder
Note: I do not respond to profile comments/personal messages in regards to troubleshooting my modifications. Please post on the public forums instead.

Baldur's Gate Trilogy-WeiDU and Mods
Throne of Bhaal Extender (TobEx)

Contributions: (NWN2) A Deathstalker (voice acting) - (IWD2) IWD2 NPC Project (soundset editing) - (Misc) SHS PC Soundsets (voice acting)
Legacy: (BG/Tutu/BGT) Beregost Crash Fixer 1.9 (18 Jul 10) - (BG2) Enable conversations with charmed/dominated creatures (18 Jul 10) - (BG2) Experience Corrections (18 Jul 10) - (Misc) Platform Conversion Utility RC2 (13 Feb 10)


#6 melkor_morgoth75

melkor_morgoth75

    Lord

  • Modder
  • 1509 posts

Posted 26 August 2008 - 04:19 AM

So it checks the level of the main character only?


Still it's not clear to me what it checks, but it doesn't work as expected or as i like/want...

Asc64: i'm currently using this coding to check the highest levelled character:

CheckStat(StrongestOf(),"X",LEVEL)

I still have to undesrtand if i can work something with dual/multiclassed members ... my next tests ;-)

mm75

PS: if u have time, have a look here->http://forums.gibber...showtopic=15298

Edited by melkor_morgoth75, 26 August 2008 - 04:20 AM.

Tired of the same boring spawned creatures u face in BG? Try BGSpawn


#7 Sasha Al'Therin

Sasha Al'Therin
  • Modder
  • 615 posts

Posted 26 August 2008 - 05:00 AM

So it checks the level of the main character only?


Still it's not clear to me what it checks, but it doesn't work as expected or as i like/want...

Asc64: i'm currently using this coding to check the highest levelled character:

CheckStat(StrongestOf(),"X",LEVEL)

I still have to undesrtand if i can work something with dual/multiclassed members ... my next tests ;-)

mm75

PS: if u have time, have a look here->http://forums.gibber...showtopic=15298

So your using the CheckStat I shared with you and the StrongestOf() that devsin shared. that's good. Now for your multi-class characters. As an example you want to look for level 5 in a fighter mage thief combo
IF
Class(StrongestOf(),FIGHTER_MAGE_THIEF)
OR(3)
CheckStat(StrongestOf(),"5",LEVEL)
CheckStat(StrongestOf(),"5",LEVEL2)
CheckStat(StrongestOf(),"5",LEVEL3)
THEN
RESPONSE #100
/* do your actions */
END
The class check is true IF the strongest is a FMT, then it would check to see if any one of their 3 classes is at level 5. However it returns true even if their lowest is at level 5.
IF
Class(StrongestOf(),FIGHTER_MAGE_THIEF)
OR(3)
CheckStat(StrongestOf(),"5",LEVEL)
CheckStat(StrongestOf(),"5",LEVEL2)
CheckStat(StrongestOf(),"5",LEVEL3)
!CheckStatGT(StrongestOf(),"5",LEVEL)
!CheckStatGT(StrongestOf(),"5",LEVEL2)
!CheckStatGT(StrongestOf(),"5",LEVEL3)
THEN
RESPONSE #100
/* do your actions */
END
This returns true if one of the three class levels of the FMT is at 5 but none of them are greater than 5.

If you use the class check you'll need at least three blocks to get the strongest checked against every class type. For example, again looking to find the strongest to be at level 5

//check strongest for triple class levels
IF
OR(2)
Class(StrongestOf(),FIGHTER_MAGE_THIEF)
Class(StrongestOf(),FIGHTER_MAGE_CLERIC)
OR(3)
CheckStat(StrongestOf(),"5",LEVEL)
CheckStat(StrongestOf(),"5",LEVEL2)
CheckStat(StrongestOf(),"5",LEVEL3)
!CheckStatGT(StrongestOf(),"5",LEVEL)
!CheckStatGT(StrongestOf(),"5",LEVEL2)
!CheckStatGT(StrongestOf(),"5",LEVEL3)
THEN
RESPONSE #100
/* do your actions */
END
// above returns true if strongest is either FMT or FMC and one of the three levels is at 5 but none over 5

// check strongest for double class levels
IF
OR(8)
Class(StrongestOf(),FIGHTER_MAGE)
Class(StrongestOf(),FIGHTER_CLERIC)
Class(StrongestOf(),FIGHTER_THIEF)
Class(StrongestOf(),MAGE_THIEF)
Class(StrongestOf(),CLERIC_MAGE)
Class(StrongestOf(),CLERIC_THIEF)
Class(StrongestOf(),FIGHTER_DRUID)
Class(StrongestOf(),CLERIC_RANGER)
OR(2)
CheckStat(StrongestOf(),"5",LEVEL)
CheckStat(StrongestOf(),"5",LEVEL2)
!CheckStatGT(StrongestOf(),"5",LEVEL)
!CheckStatGT(StrongestOf(),"5",LEVEL2)
THEN
RESPONSE #100
/* do your actions */
END
//the above returns true if the strongest is either FM, FC, FT, MT, CM, CT, FD, or CR and one of their levels is at 5 and none over 5

//check strongest for single class levels
IF
!Class(StrongestOf(),FIGHTER_MAGE_THIEF)
!Class(StrongestOf(),FIGHTER_MAGE_CLERIC)
!Class(StrongestOf(),FIGHTER_MAGE)
!Class(StrongestOf(),FIGHTER_CLERIC)
!Class(StrongestOf(),FIGHTER_THIEF)
!Class(StrongestOf(),MAGE_THIEF)
!Class(StrongestOf(),CLERIC_MAGE)
!Class(StrongestOf(),CLERIC_THIEF)
!Class(StrongestOf(),FIGHTER_DRUID)
!Class(StrongestOf(),CLERIC_RANGER)
CheckStat(StrongestOf(),"5",LEVEL)
THEN
RESPONSE #100
/* do your actions */
END
//the above returns true if the strongest is not any of the multi/dual class characters and there level is 5.
This may get you closer to what you want. However, I don't know yet how to determine which class is currently active in a dual class character. There maybe situations where you have the strongest as a dualled fighter/thief and their fighter class is 5 and their thief class is 4. They're active in the thief but their inaccessible fighter level would still make them return true.

My working mods:
an AI Party Script for BG2 game engine DOWNLOAD LINK ONLY!
Interactive Tweaks for BG series with some IWD support. DOWNLOAD LINK ONLY!
Rest For 8 Hours an IWD mod
-------------------------------------------
My contributions: BG1Fixpack, BG1Tweaks
On Hold: Solestia an NPC for SOA
-------------------------------------------
My website: http://sasha-altheri...s.com/index.htm


#8 melkor_morgoth75

melkor_morgoth75

    Lord

  • Modder
  • 1509 posts

Posted 26 August 2008 - 05:24 AM

Thanks mate,

exactly .. i dunnow how to check for "the active" class in a dual-classed character, but i don't really want to check the active class eventually.

Anyway, i really don't wanna check the class(es) (it would be really too huge) so would it be enough a check as the following?

OR(3)
CheckStat(StrongestOf(),"5",LEVEL)
CheckStat(StrongestOf(),"5",LEVEL2)
CheckStat(StrongestOf(),"5",LEVEL3)
!CheckStatGT(StrongestOf(),"5",LEVEL)
!CheckStatGT(StrongestOf(),"5",LEVEL2)
!CheckStatGT(StrongestOf(),"5",LEVEL3)
THEN
RESPONSE #100
/* do your actions */
END

In this case i would have a check for a 5 Level strongest and NO higher levels, without headaches of all the multiclasses, am i correct? Level2 and Level3 for any NON dual or multi characters are equal always to 0.

mm75

Edited by melkor_morgoth75, 26 August 2008 - 05:32 AM.

Tired of the same boring spawned creatures u face in BG? Try BGSpawn


#9 melkor_morgoth75

melkor_morgoth75

    Lord

  • Modder
  • 1509 posts

Posted 01 September 2008 - 06:16 AM

Ok,

i tested the code above and it works beautifully. I'm going to use it for my mod.

StrongestOf does NOT return the higher levelled party member (quite...) but it's perfect for what i have in mind with my system. It should check for levels, hp, strength, etc ... and return the strongest member.

Definitely LevelParty does NOT return the highest levelled party member unfortunately.

Cheers and ... wish me luck, ehehhehehe :-)

mm75

Tired of the same boring spawned creatures u face in BG? Try BGSpawn


#10 -Guest-

-Guest-
  • Guest

Posted 01 September 2008 - 09:44 PM

LevelParty() is just that -- the whole party level. Of course, I have no idea what the party level would actually be, but it should work correctly (not for what you want, which is what StrongestOf is mostly there for). LEVEL2 and LEVEL3 will usually either be 0 or 1 in single-class party members and can be anything in NPCs.

You might want to try checking for experience (XP(), XPLT(), XPGT()) instead of explicit level checks (at nXP, everybody should be at relatively the same effective level; e.g., two characters with 100K XP are roughly equivalent, regardless of whatever class levels that translates to).