Jump to content

NumCreatureGT


temnix

Recommended Posts

I'm trying this code:

 

IF
ActuallyInCombat()
NextTriggerObject(Protagonist)
Detect([ENEMY])
!StateCheck(LastSeenBy,STATE_HELPLESS)
!StateCheck(LastSeenBy,STATE_PANIC)
NumCreatureGT([ENEMY],4)

THEN
RESPONSE #100
Kill(Protagonist)
END

 

As soon as he gets in a little hostile crowd, Charname is supposed to die. But he persists, the Bhaalspawn that he is. Why?

Link to comment

This is for baldur.bcs, hence the assignment to Protagonist. I'll see if your action works any better.

Who is that baldur? How does he detect, how does he see? What is his position to determine distance from?

 

My code will not work better than any other in this case...

Link to comment

Is ActuallyInCombat a global condition, or does the NextTriggerObject need to precede that trigger too? Ditto both state checks (you want LastSeenBy relative to Protagonist too).

 

NextTriggerObject(O:Object*)

BG2EE only. Defines the object that the next trigger will be evaluated in reference to. This trigger does not evaluate and does not count as a trigger in an OR() block. If the object cannot be found, the next trigger will evaluate to false.

 

... Why not put this code in player1.bcs instead, though?

Link to comment

Is ActuallyInCombat a global condition, or does the NextTriggerObject need to precede that trigger too? Ditto both state checks (you want LastSeenBy relative to Protagonist too).

 

NextTriggerObject(O:Object*)

BG2EE only. Defines the object that the next trigger will be evaluated in reference to. This trigger does not evaluate and does not count as a trigger in an OR() block. If the object cannot be found, the next trigger will evaluate to false.

 

... Why not put this code in player1.bcs instead, though?

@agb1

This is exactly what I was aiming at, littering baldur.bcs with EXTEND_TOP my-blocking-all-after-me-code is...*This place is dead" ... (By the way - what is player1,bcs?)

 

There is so much false information published with much verve and you receive nothing but insults if you try to shed some light into things.

 

I quote from:

 

 

Roxanne's Myths and Legend's of the Sword Coast

 

1. Baldur.bcs is the highest priority script running in the game. It is the Game's own file, in a hierachy layer of its own. It is assigned to no one and no place, it is everpresent smoke on the water

2. The player character has NO override script. Or in other words, his override is sitting in from of the screen and controls his actions.

3. There is a Player1D.bcs in the game which controls triggering the various dream scenes the player gets along the game's progression. Like all dreamfiles, it is automatically triggered when resting the party.

4. Player character can have a class script that you assign yourself in game if you want the AI to "improve" combat for you. This is selected via the character screens during play - in the EEs it is assigned per default according to the players class selection but can be de-assigned from the same menu.

5. Player character has a default script dplayer3.bcs (equivalent to NPC's dplayer2) which triggers some events that may kill the player like the Iron Throne poisoning attack or the Werewolf Island episode (if no cure is found).

6. Player character has NO dialogue file assigned. The dialogue options for the player are part of the dialogues of the people that talk to you (This is why actions in a DO of a response are applied from/on the person spoken to, not on the player). There is a Player1.dlg in the game which is triggered and applied by ActionOverride to the Player only on specific occasions by respective scripts - this file contains the *self-talks* of your character, e.g. when you recognise your lost soul or when you near the tree of life.

7. Player character and Player1 may not always be the same creature.

 

Now, you can surely create a script via mod and force its assignment to the player character to make it your puppet but I cannot see a wide acceptance of a mod that would do such a thing.

Link to comment

I was thinking of the dplayer script, I suppose, when I wrote player1.bcs. When is Player1 not the player character? Does changing the order of the party also change Player1?

 

I am not advocating the gameplay or compatibility/performance merits of whatever temnix is doing here - just exploring what is technically possible with scripting.

Link to comment

I was thinking of the dplayer script, I suppose, when I wrote player1.bcs. When is Player1 not the player character? Does changing the order of the party also change Player1?

 

I am not advocating the gameplay or compatibility/performance merits of whatever temnix is doing here - just exploring what is technically possible with scripting.

 

When is Player1 not the player character?

You can replace him/her in a number of ways (it is done by some mods, including e.g. my own - in the last part Time of Troubles Revisited you play the game from the perspective of one of the old heros who fought Bhaal and his companions) Some mods do that on a temporary basis.

 

Does changing the order of the party also change Player1?

No, at least not to my knowledge. Party slot is not identical to who is player 1-6. Just for the special case of the player character beeing Player1 because its is the first one ever to be in party and the only constant party member as you cannot kick it out. So unless you *trick* it, this will be maintained throughout the game. Means, there is no explicit *binding* of player to Player1, it simply happens this way because this is how the party creation process starts every time. (I admit that it is very long ago that I looked into these mechanics - so I cannot say for sure that in the EE's all of that is unchanged. But I see no reason today anymore to investigate it.)

 

PS - before we hijack this thread

dplayer3.bcs may be *misused* for killing actions applied on the PC.

Link to comment

...

Have you ever tired to testing the game with the LStest mod I have ? You'll soon see that indeed the baldur.bcs is ever present, the other smaller option of course is the baldur25.bcs that is used specifically in ToB game...

 

If you go and search with Near Infinity of the player1 ... it's not used as a .bcs, but as the identifier for commands for ActionOverride(...'s, and indeed, it's not the party slot, but the slot the player character is saved in at, in the saves. Aka the Player1 is the first party member, aka Bhallspawn in the savegames pictures... or if you use the GameOverOnlyOnPartyDeath mod, then you can actually have other party members as the Bhallspawn successor. Again as Bhallspawn, aka Player1. When you get the Bhallspawn dead and make Minsc the power house he really ought to be.

Link to comment

No-no. You only hear insults if you are wrong. Of course, I've been wrong myself, and not infrequently. Feel free to call me names if I say something stupid. But I can only be blamed for my own ideas which turned out to be incorrect. I've never presumed to help another with information that wasn't 100% verified by my own experience.

 

And speaking of proving by experience, let's make a few things clear about the original script.

 

1. NextTriggerObject works in both BGEE and BG2EE. It determines who will make the following check. That should answer the questions about who detects and how. It's true that NextTriggerObject only works for the very next one. I didn't know this, so thanks, agb1. I need the first trigger assignment for Detect, but in principle I can write concretely who the object is for LastSeenBy. The code then becomes:

 

IF
ActuallyInCombat() /// This one doesn't need an object, obviously
NextTriggerObject(Protagonist)
Detect([ENEMY])
!StateCheck(LastSeenBy(Protagonist),STATE_HELPLESS)
!StateCheck(LastSeenBy(Protagonist),STATE_PANIC)
NextTriggerObject(Protagonist)

NumCreatureGT([ENEMY],4)

THEN
RESPONSE #100
Kill(Protagonist)
END

 

And this one works.

 

2. As for littering baldur.bcs, there is no need to worry about that overmuch. I was concerned about it myself at first, afraid that the engine might slow down if there were more then a few blocks there, but no such thing happened. The game runs the script's checks and actions just fine with very sizeable additions, and the original script, the unaltered one, is quite short. It has only a few things in it. So there is no danger, and neither is there an alternative place for scripts that have an overarching, general effect. In this case the script refers to Protagonist because there is no way to assign a trigger to "any PC". I suppose I could move custom additions to another script that is always on, but which one? Dplayer? I could do that, but only if the script runs regardless of whether AI is turned on or not.

Link to comment

but which one? Dplayer? I could do that, but only if the script runs regardless of whether AI is turned on or not.

How about area scripts that have more than 4 civilians in it. Or how about creatures that have the INNOCENT flag as their class.

 

The NumCreatureGT([ENEMY],4)

Won't be good especially if the enemies are hostile creatures... like for example 4 bandits.. the protagonist is dead. Yey for no gang violence, cause if you involve yourself with one... you end up dead.

Link to comment

Hah hah hah! :D It was an example script. I need the NumCreatureGT trigger for something else, but Kill(Protagonist) is always the easiest action to test a trigger.

 

The script needs to be ready to go off anywhere, though.

Link to comment

Hah hah hah! :D It was an example script. I need the NumCreatureGT trigger for something else, but Kill(Protagonist) is always the easiest action to test a trigger.

Then why did you drag all this BS with it:
    ActuallyInCombat()
    NextTriggerObject(Protagonist)
    Detect([ENEMY])
    !StateCheck(LastSeenBy,STATE_HELPLESS)
    !StateCheck(LastSeenBy,STATE_PANIC)
???
Link to comment

Archived

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

×
×
  • Create New...