NumberWan Posted April 3, 2016 Posted April 3, 2016 This one is partly related to coding, but for the most it's about things (e.g. entities), that are present in JA, but don't work. Last time I asked about scaling a model in the game via a script, as some of you might remember. But set_scale doesn't work in game, not in any way, even though the docs say otherwise.This time I would like to talk about target_give, which is present in JA. It can serve as an object, which when activated, can give the Player certain items. E.g. the Player uses the button and gets some ammo. Easy as easting a pie.But it won't work for me, though I followed all the instructions. When loading a map and using the trigger, the map would crash back to the Main Menu and show this message: Error:BG_CanItemBeGrabbed:index out of rangeI searched the Internet for possible answers, but most people encountered the very same problem even back in 2008. I wonder why doesn't it work in SP (haven't tried it in MP).I also tried an alternative: made a script, which has a command of set_item. It works a bit different, and crashes sometimes with a different error depending on the item (for instance, it doesn't work at all with Ammo, but it's not the same with medpack).Has anyone looked into this? Is there any alternative to this one?Maybe coders can could look into this too.
mrwonko Posted April 4, 2016 Posted April 4, 2016 This does sound like a bug in the code, if I find some time I'll look into it.
ensiform Posted April 4, 2016 Posted April 4, 2016 Pretty sure it works in MP as its designed to give items on spawn. The error suggests that the item being linked to it is simply either not really an item or is something strange happening because SP is weird with item loading. Its possible the items are loaded from items.dat later on thus bg_numItems is either uninitialized or is 0? Which would be a code issue! eezstreet likes this
NumberWan Posted April 4, 2016 Author Posted April 4, 2016 Okey, I see. In any case thanks for the suggestions!
ensiform Posted April 4, 2016 Posted April 4, 2016 I actually just checked the code and it seems to load items.dat prior to spawning of any entities so idk. The error message happens when the item index is < 1 or >= max.
Aimde Posted November 1 Posted November 1 Any news of this issue by any chance? I'm facing it right now.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now