This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
give_item [2017/04/12 16:23] – justin | give_item [2023/04/26 12:19] – justin | ||
---|---|---|---|
Line 2: | Line 2: | ||
---- | ---- | ||
- | Gives the specified item to the player. The name of the item is case-sensitive and should match the name as defined | + | Gives one or more of the specified |
+ | ====Signature: | ||
<code python> | <code python> | ||
- | give_item(item_name) | + | give_item(item_id, count, character) |
</ | </ | ||
^Argument^Description^Type^Required^ | ^Argument^Description^Type^Required^ | ||
- | |item_name|Name of the item.|[[String]]|Yes| | + | |item_id|ID of the [[item]] (as defined in the [[Item Editor]]).|[[String]]|Yes| |
+ | |count|How many of the [[item]] to give to the player (defaults to 1).|[[Number]]|No| | ||
+ | |character|[[Character]] the [[item]] will be given to (defaults to the main [[player character]]).|[[Entity]]|No| | ||
+ | |||
+ | ^Return Value^Description^Type^ | ||
+ | |Number Given|Returns the actual number of [[item|items]] that were given to the player. This could be less than the count supplied to the function, for example if the player' | ||
====Example: | ====Example: | ||
- | < | + | < |
- | give_item(" | + | give_item(" |
</ | </ | ||
- | // | + | // |
<WRAP center round tip 100%> | <WRAP center round tip 100%> | ||
- | Use the **Give Item** function to reward the player for completing a quest or as a way of collecting items from treasure chests and other containers. | + | Use the **Give Item** function to reward the player for completing a quest or as a way of collecting |
</ | </ | ||