Jump to content


Photo

Strange Script pattern


  • Please log in to reply
3 replies to this topic

#1 RYUchan

RYUchan
  • Member
  • 99 posts

Posted 29 June 2010 - 07:43 AM

I've encountered a strange (I think) thing while I was looking through Weimer's Item Upgrade mod. I believe this is an error if it's not then I'm confused and want an explanation :)


The recipe for two short swords sais:

You need:
Chaos
Entropy
Scroll of Chaos
Scroll of Greater Malison
Ilbratha
Arbane
Rogue Stone
25,000 Gold

You Get:
Creeping Chaos
(+3 weapon, 5% confuse target, 2 pt dex drain)
Inevitable Entropy
(+3 weapon, 5% cast malison on target, 6 pts poison)
****************************************************************************


IF ~~ THEN BEGIN hd
    SAY @123498 IF ~~ THEN REPLY @123435 GOTO 4
    IF ~PartyHasItem("npsw05") PartyHasItem("npsw06") 
        PartyHasItem("SW1H26") PartyHasItem("SW1H27") 
        PartyHasItem("misc45") PartyHasItem("scrl5p") 
        PartyHasItem("scrl5i") 
        PartyGoldGT(24999)~
      THEN REPLY @123436 
      DO ~TakePartyGold(25000)      DestroyGold(25000)
          TakePartyItemNum("npsw05",1)   DestroyItem("npsw05")
          TakePartyItemNum("npsw06",1)   DestroyItem("npsw06")
          TakePartyItemNum("sw1h26",1)   DestroyItem("sw1h26")
          TakePartyItemNum("sw1h27",1)   DestroyItem("sw1h27")
          TakePartyItemNum("misc45",1)   DestroyItem("misc45")
          TakePartyItemNum("scrl5p",1)   DestroyItem("scrl5p")
          TakePartyItemNum("scrl5i",1)   DestroyItem("scrl5i")
          TakePartyItemNum("dagg16",5)   DestroyItem("dagg16")
          GiveItemCreate("c2hd1",Player1,1,1,1)
          GiveItemCreate("c2hd2",Player1,1,1,1)
          CreateVisualEffect("spcrtwpn",[401.348])~ EXIT
    IF ~PartyHasItem("npsw05") PartyHasItem("npsw06") 
        PartyHasItem("SW1H26") PartyHasItem("SW1H27") 
        PartyHasItem("misc45") PartyHasItem("scrl5p") 
        PartyHasItem("scrl5w") 
        PartyGoldGT(24999)~
      THEN REPLY @123436
      DO ~TakePartyGold(25000)      DestroyGold(25000)
          TakePartyItemNum("npsw05",1)   DestroyItem("npsw05")
          TakePartyItemNum("npsw06",1)   DestroyItem("npsw06")
          TakePartyItemNum("sw1h26",1)   DestroyItem("sw1h26")
          TakePartyItemNum("sw1h27",1)   DestroyItem("sw1h27")
          TakePartyItemNum("misc45",1)   DestroyItem("misc45")
          TakePartyItemNum("scrl5p",1)   DestroyItem("scrl5p")
          TakePartyItemNum("scrl5w",1)   DestroyItem("scrl5w")
          TakePartyItemNum("dagg16",5)   DestroyItem("dagg16")
          GiveItemCreate("c2hd1",Player1,1,1,1)
          GiveItemCreate("c2hd2",Player1,1,1,1)
          CreateVisualEffect("spcrtwpn",[401.348])~ EXIT
  END

First question is: I don't understand why there are two blocks of DO, I can't figure out what purpose the second block after DO has.

Second question is: "TakePartyItemNum("dagg16",5) DestroyItem("dagg16")" is obviously an error because you don't need poison throwing daggers according to the recipe, well maybe this is an error in the recipe :).

Thanks for the answers!

RYUchan

Edited by RYUchan, 29 June 2010 - 07:57 AM.


#2 cmorgan

cmorgan
  • Modder
  • 2301 posts

Posted 29 June 2010 - 08:27 AM

For the replicated DO actions, take a look carefully at the triggers - there are different "recepies" that get evaluated from bottom to top. Each reply state is slightly different.
scrl5i <> scrl5w

For the other, Lollorian has repaired this, I think - check this thread at PPG and the repaired files are there. The mod should be updated with his work pretty darned soon, if everything works out well enough.

The schematic for this code is

IF ~~ THEN BEGIN hd
SAY @1234354
IF ~{no set available, nothing evaluated true yet}~ THEN REPLY @123435 GOTO 4
IF ~{set 1}~ THEN REPLY @123436 DO ~{actions}~ EXIT
IF ~{set 2}~ THEN REPLY @123436 DO ~{actions}~ EXIT
END

With evaluation from bottom to top:

is Set 2 = true? NO. so
is Set 1 = true? NO. so
is novalidconditions = true? ALWAYS. so jump to state 4.



Edited by cmorgan, 29 June 2010 - 08:35 AM.


#3 RYUchan

RYUchan
  • Member
  • 99 posts

Posted 29 June 2010 - 08:48 AM

For the replicated DO actions, take a look carefully at the triggers - there are different "recepies" that get evaluated from bottom to top. Each reply state is slightly different.
scrl5i <> scrl5w


Well I did notice this. But didn't get the reason. Now I looked through items in NI and understood the point :)

For the other, Lollorian has repaired this, I think - check this thread at PPG and the repaired files are there. The mod should be updated with his work pretty darned soon, if everything works out well enough.


Thanks for the link. Though it's still has daggers in the code, so maybe he did intended to add them and the readme has a mistake..


IF ~~ THEN BEGIN hd
SAY @1234354
IF ~{no set available, nothing evaluated true yet}~ THEN REPLY @123435 GOTO 4
IF ~{set 1}~ THEN REPLY @123436 DO ~{actions}~ EXIT
IF ~{set 2}~ THEN REPLY @123436 DO ~{actions}~ EXIT
END


Thank you for the detailed explanation :)

Edited by RYUchan, 29 June 2010 - 12:56 PM.


#4 -cmorgan-

-cmorgan-
  • Guest

Posted 12 August 2010 - 07:58 AM

editing out

TakePartyItemNum("dagg16",5) DestroyItem("dagg16")

and building package for PPG based on Lollorian's work. (All his work, not mine - just acting as middleman).