Task reward_item doesn't work in 1.5 R6, what to use?

sLoPpYdOtBiGhOlE
Scavenger
Posts: 36
Joined: 12 Jun 2017, 23:44

Task reward_item doesn't work in 1.5 R6, what to use?

Postby sLoPpYdOtBiGhOlE » 17 Jan 2018, 19:42

I'm unsure if this is intended as the task sytsem evolved in 1.5.
I did look through the version change logs to see if it was mentioned and didn't see anything.
reward_item in tm_xxxxx.ltx no longer works.

I see reward_item = vodka in tm_zaton.ltx for Beard's kill the mutants task.
Completing the task never gets you the bottle vodka.

I've also tried using reward_item in my own simple fetch tasks and it never works.
So instead I'm using reward_random_item() with a single particular item in on_complete.

What method should I use to give a non random particular item or non random multiple reward items?

User avatar
DoctorX
Trespasser
Posts: 57
Joined: 10 Mar 2016, 00:36

Re: Task reward_item doesn't work in 1.5 R6, what to use?

Postby DoctorX » 17 Jan 2018, 21:15

Yeah, the standalone reward_item entry stopped working a while ago, wasn't a very good way to do it anyway.

Unaltered, reward_random_item with a single item in on_complete is the simplest way to give a single item. I still use it. You could call it multiple times in on_complete to add more than one item.

Beyond that, you could add a custom function to xr_effects.script to give multiple items. This should do it:

Code: Select all

function reward_multiple( actor, npc, p )
   if ( p and #p > 1 ) then
      for i = 1, #p do
         if ( db.actor ) then
            dialogs.relocate_item_section( db.actor, p[i], "in" )
         end
      end
   end
end

User avatar
DoctorX
Trespasser
Posts: 57
Joined: 10 Mar 2016, 00:36

Re: Task reward_item doesn't work in 1.5 R6, what to use?

Postby DoctorX » 17 Jan 2018, 21:22

Actually, use give_item. Forgot about that one.

Works for single items or lists.

sLoPpYdOtBiGhOlE
Scavenger
Posts: 36
Joined: 12 Jun 2017, 23:44

Re: Task reward_item doesn't work in 1.5 R6, what to use?

Postby sLoPpYdOtBiGhOlE » 17 Jan 2018, 21:38

Thank you Doctor X,
That's the one I was missing "give_item() "
That seems more appropriate for what I was wanting to do.

Cheers

Edit: I had no success feeding it a list though
eg: =give_item(token_abakan:ammo_5.45x39_ap) fails
But it works fine for a single item, minor drawback though it doesn't send a news event.
Looks like I'll stick with reward_random_item() called multiple times if needed.


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest