Project

General

Profile

 

Also available in: PDF

Accessing multiple rewards with RewardWindow

To use this test script, create a file in your /innerspace/scripts folder called RewardWindow.iss and place the entire text below. Then, you can run the script by typing the following command in the InnerSpace console (while in the game): run RewardWindow.   (Note:  You will need to have a reward window up and active for this to work.)


function main()
{
    variable int Counter = 1
    
    if !${RewardWindow(exists)}
    {
        echo "No RewardWindow exists."
        return
    }
        
    echo "RewardWindow has ${RewardWindow.NumRewards} rewards available."
    
    do
    {
          echo "- [${RewardWindow.Reward[${Counter}].LinkID] ${RewardWindow.Reward[${Counter}].Name}}"
    }
    while ${Counter:Inc} <= ${RewardWindow.NumRewards}
}


When dealing with a rewardwindow with multiple rewards, you can accept rewards by doing so within a loop such as the one above (in the 'do' loop, you would RewardWindow:AcceptReward[${RewardWindow.Reward[${Counter}].LinkID}].)   If you know the LinkID and/or name of the reward, you can accept it from the rewardwindow datatype with either RewardWindow:AcceptReward[LINKID#] or RewardWindow:AcceptReward["NAME"].

Finally, please note that the "Accept" and "Receive" methods of the RewardWindow datatype will still work for rewardwindows with only one option (i.e., older scripts do not need to be adjusted.)