Jump to content


Photo

Looking to make buffs/costly scripts not be executed more than once if


  • Please log in to reply
29 replies to this topic

#21 10th

10th
  • Member
  • 621 posts

Posted 28 November 2011 - 11:03 AM

Eh? 200%?


All posts following that one over at G3 from the bigg answer your question.

10th
Avast! You cannot defeat our titan-mounted submarine staffed by cannibal vikings! - Nodwick

"I grab his deceased spirit and piledrive it back into his body, duplicating raise dead." - Psyren Oots board

#22 Sasha Al'Therin

Sasha Al'Therin
  • Modder
  • 615 posts

Posted 28 November 2011 - 01:25 PM

Seems Bioware went and changed things and never updated documentation for the script compiler they made available with ToTSC

Definitions:
Creature:
Creatures include all objects capable of action. This includes player characters.
Trigger:
A trigger is sent to a creature when a certain event occurs. A trigger includes the knowledge of the cause of the trigger
Condition:
A combination of triggers joined with ands.
Action:
A specified response to a condition. An action requires the knowledge of who (or what) to perform the action upon.
Response:
A combination of actions which will be performed sequentially. It is possible for a response to be interrupted.
Response Set:
A combination of Responses, each with a weighting from 1 to 100. This weighting is used to randomly determine which response is actually executed.

the requirement of 1 to 100 always lead me to believe the values to be in %s with the higher being more likely than the lower.

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


#23 i30817

i30817
  • Member
  • 611 posts

Posted 28 November 2011 - 01:45 PM

dp

Edited by i30817, 28 November 2011 - 01:59 PM.


#24 i30817

i30817
  • Member
  • 611 posts

Posted 28 November 2011 - 01:59 PM

Hey there hi there

I think i've found a way to only one person to cast a party buff without timers (that i will not use because i'm using alacrity to speed up the buffs if not in combat and not if in combat).

Edit: was buggy
What do you think?

Edit: coded edited.

Edited by i30817, 29 November 2011 - 02:56 AM.


#25 Sasha Al'Therin

Sasha Al'Therin
  • Modder
  • 615 posts

Posted 28 November 2011 - 02:43 PM

i don't know

have you tried it in game?

TriggerOverride is that Tobex stuff? if you're dealing with that, you've moved beyond my understanding.

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


#26 i30817

i30817
  • Member
  • 611 posts

Posted 28 November 2011 - 08:49 PM

Not yet, just trying to debug in my head before doing it for real. TriggerOverride is just the TobEx introduced equivalent of ActionOverride.

I changed things. There probably was a error in the :
StateCheck(Player1, CD_STATE_NOTVALID)

This is the most important part of what i have now:
Spoiler



See, the idea is to reset the lasttrigger at the start; then cascade by the possible team members looking for a possible caster.

HP(Nothing,0) is supposed to always be true and set the lasttrigger to nothing (i don't really know if this works)

So,
In the OR, if NotStateCheck(Player1, CD_STATE_NOTVALID) succeeds (ie: not not valid => valid) is supposed to save the lasttrigger, not save it if false.

This is my greatest doubt: does the lasttrigger gets saved only on success?

The InMyGroup(Trigger) checks in subsequents ORs are just a optimization if the lasttrigger is no longer "Nothing".


So two doubts:
is HP(Nothing,0) always true and saves nothing as the lasttrigger? (I guess i could chose another Object as lasttrigger as long as they are not potential party members)

Does the lasttrigger of NotStateCheck gets saved only on success?

Edited by i30817, 28 November 2011 - 11:43 PM.


#27 i30817

i30817
  • Member
  • 611 posts

Posted 29 November 2011 - 02:00 AM

HP(Nothing,0) returns false, but i found a better way:
Allegiance(Nothing, ANYTHING) returns true (as well as Allegiance(Nothing, GOODCUTOFF)).
Exists(Nothing) returns true too (funny isn't it) but probably checks a list internally so it's better to use the other.

Now to check if actually changes LastTrigger, and If lasttrigger actually doesn't get changed if it is false.

Edited by i30817, 29 November 2011 - 02:15 AM.


#28 i30817

i30817
  • Member
  • 611 posts

Posted 29 November 2011 - 02:19 AM

nvm see below.

Edited by i30817, 29 November 2011 - 02:37 AM.


#29 i30817

i30817
  • Member
  • 611 posts

Posted 29 November 2011 - 02:37 AM

I am doing something wrong:


Allegiance(Myself, PC)//true
CharName("Rothgar",Myself)//true

This matches with Rothgar running the script (i'm using the tobcleric dude to test).


This doesn't match:
Allegiance(Myself, PC)//true
CharName("Rothgar",LastTrigger)

although Allegiance is in this page:
http://iesdp.gibberl...g2/svtriobj.htm

that says it records the trigger (i'm assuming in the LastTrigger right?)

Edited by i30817, 29 November 2011 - 02:38 AM.


#30 Sasha Al'Therin

Sasha Al'Therin
  • Modder
  • 615 posts

Posted 29 November 2011 - 04:46 PM

the triggers in svtriobj.ids are scripting variable trigger objects which means that they can utilize any object/creature that has a scripting variable. Tho common sense is needed because things like HP(O:Object*,I:Hit Points*) will only work on a creature while Unlocked(O:Object*) works only on containers and doors. valid objects aside from those using a scripting variable name (containers/doors/actors) are also those listed in objects.ids which are typically an actor determined by a combination of triggers in svtriobj.ids.
Example
Spoiler

Triggers listed in this file have their trigger object saved (in memory) and are therefore compatible with the Trigger() trigger.

not exactly sure what that means as the in game usage of Trigger() takes a number.

Example from BG1:
Spoiler



LastTrigger is used in this manner
Spoiler

This doesn't match:
Allegiance(Myself, PC)//true
CharName("Rothgar",LastTrigger)

maybe actor running the script doesn't get stored as the object, hence Myself works whereas LastTrigger does not?

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