Jump to content

(O:Target*,I:ScrollSpeed*Scroll)?


Jarno Mikkola

Recommended Posts

In the Script Actions there's several common phrases that makes no sense to me, so I have to use them to try to learn, but that's inconvenient. So is there a library that would tell me what exactly each of those means? By giving an example or whatever... of code and then telling what it does. And is the 0, one already... :(

 

This is all actually from not knowing what those 3 zeroes are for... in the tutorial. Just would like to know...

82 CreateItem(S:ResRef*,I:Usage1*,I:Usage2*,I:Usage3*)
This action creates the specified item (resref) on the active creature. The usage parameters determine the number of items created or the number of charges on the item, depending on the item type being created. The example script is from AR0602.

 IF
Global("BG1Pantaloons","GLOBAL",0)
PartyHasItem("MISC47")
 THEN
RESPONSE #100
  SetGlobal("BG1Pantaloons","GLOBAL",1)
  ActionOverride("Picture1",CreateItem("MISC47",0,0,0))
  Continue()
 END

Yes, I understand some of that, but it's not exactly clear... :(

Link to comment

From an older version of IESDP

 

82 CreateItem(S:ResRef*,I:Usage1*,I:Usage2*,I:Usage3*)

A very useful command. Creates an Item as the RESREF. Usage 1 is the number of charges the item has, or if its a scroll the number of scrolls. This a script from AR0602 (Irenicus Dungeon) that recreates the pantaloons in a container (the picture) if the pantaloons are imported.

 

IF

Global("BG1Pantaloons","GLOBAL",0)

PartyHasItem("MISC47")

THEN

RESPONSE #100

SetGlobal("BG1Pantaloons","GLOBAL",1)

ActionOverride("Picture1",CreateItem("MISC47",0,0,0))

Continue()

END

 

Usages 1, 2, and 3 are similar to how the CLUAConsole works... If a weapon has multiple extended headers (abilities), then you can set the number of charges for those abilities with usages 2 and 3.

 

Or, if you wanted to create a stack of arrows, you could use...

 

IF

True()

THEN

RESPONSE#100

CreateItem("AROW01",Myself,20,0,0)

END

Link to comment

Heh?

It is clear that those 3 0's are the charge counts for that particular item.

Since the pantaloo is not charged nor a pile item, those parameters are unused.

And as a convention, 0's are used for unused parameters.

 

Usage1 is the item count for pile items. Like arrows.

Otherwise the Usage parameters are the charge counts for the first 3 extended headers. Like wand of fire.

Link to comment

Well the older description, albeit less concise and a little more abstruse, at least tells you more clearly what each of the usages are for.

 

E.g.

"The usage parameters determine the number of items created or the number of charges on the item, depending on the item type being created." can imply that depending on the item type you use (which isn't specified by the text, which item types?, all 3 usages determine either #items or #charges). When writing descriptions, you have to KISS them all and state everything.

Link to comment

"82 CreateItem(S:ResRef*,I:Usage1*,I:Usage2*,I:Usage3*)"

 

S:ResRef* is your filename. S: means a String, and I am pretty sure you know what we mean.

 

I: is an integer, anywhere between 0 and 65535

 

O: is Object, which probably refers to Objects.ids, but it can be used generally as well, afaik. IE, [PC] would probably work, but I'm not sure, and Myself definitely will.

 

A: is Action, which AFAIK is only used by ActionOverride(), uses Actions.ids

 

P: is a point, usually on the map. Points are a set of numbers like this [X.Y], within your ().

 

And that covers it, I think.

 

Icen

Link to comment

Archived

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

×
×
  • Create New...