Jump to content

PartyRested() Bug ?


Recommended Posts

Posted

I don't get it. I've assigned this script to a kit, I've checked through EEkeeper that the script is associated with the kit (ok), I've changed PartyRested() to True() to see (and it works, the spell is cast in a loop), so what's wrong with PartyRested()???

IF
    PartyRested()
THEN
    RESPONSE #100
        ApplySpellRES("spwi309",Myself)  // No such index
END

 

Posted

I think it's true only if checked immediately after a rest. So if another script has precedence and runs in that tick, it will be too late by the time this block in your script is reached.

Posted

PartyRested() is used in many scripts associated with pnjs for romances. Are you saying that some of the lovetalk associated with PartyRested() might not be displayed because another script is running and overriding this instruction?

Posted

Just delaying, but yes. It's like OnCreation() which will only match on the first tick or the other non-0x4000 triggers, which also only work immediately after an event.

So if you have this script block in let's say the class script slot and something else in the override slot, if some condition matches in the override script, the class script won't even get a chance to run.

Posted

Ok, thank you, it works by placing the script in the OVERRIDE slot. But am I taking a risk by using this slot that another mod will overwrite it?

Posted
40 minutes ago, deratiseur said:

Ok, thank you, it works by placing the script in the OVERRIDE slot. But am I taking a risk by using this slot that another mod will overwrite it?

It depends on what mods your using. You can always check the WeiDU changelog if you need to debug.

Also, here are two functions you can call to help with compatibility when placing scripts. They place the script in either the highest or lowest location and move any others up or down. 

Spoiler
DEFINE_PATCH_FUNCTION CRE_insert_script_high
     STR_VAR
         script=""
BEGIN
     FOR (i=0x248;i<0x270;i=i + 8) BEGIN
        READ_ASCII i ~test~
        SET blank=0
        PATCH_IF ~%test%~ STRING_EQUAL_CASE ~~ OR ~%test%~ STRING_EQUAL_CASE ~none~ BEGIN
           SET blank=i
           SET i=0x270
        END
     END
     PATCH_IF blank=0 BEGIN
          PATCH_PRINT "Failed to find a space to insert %script%"
     END ELSE BEGIN
           FOR (i=blank;i>0x248;i=i - 8) BEGIN
              READ_ASCII i - 8 ~move~
              WRITE_ASCIIE i ~%move%~ (8)
           END
           WRITE_ASCIIE 0x248 ~%script%~ (8)
     END
END

DEFINE_PATCH_FUNCTION CRE_insert_script_low
     STR_VAR
         script=""
BEGIN
     FOR (i=0x268;i>0x240;i=i - 8) BEGIN
        READ_ASCII i ~test~
        SET blank=0
        PATCH_IF ~%test%~ STRING_EQUAL_CASE ~~ OR ~%test%~ STRING_EQUAL_CASE ~none~ BEGIN
           SET blank=i
           SET i=0
        END
     END
     PATCH_IF blank=0 BEGIN
          PATCH_PRINT "Failed to find a space to insert %script%"
     END ELSE BEGIN
           FOR (i=blank;i<0x268;i=i+8) BEGIN
              READ_ASCII i+8 ~move~
              WRITE_ASCIIE i ~%move%~ (8)
           END
           WRITE_ASCIIE 0x268 ~%script%~ (8)
     END
END

You call them like this:

Spoiler
COPY_EXISTING ~ACOLYTE1.CRE~ ~override~
  LPF CRE_insert_script_high
    STR_VAR
      script = ~WTASIGHT~
  END
BUT_ONLY

 

Posted

OVERRIDE slot is usually filled with a script that is custom to the specific cre. It's not common to replace it with another one.

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...