Page 1 of 1

Inventory - differently

Posted: Sun Aug 20, 2006 1:23 am
by Fallen
I have another question :oops:

I have a game that supposively will rely on the use of "tools" quite a bit. You can relate the idea to old point and click adventures like "Kings Quest" and "Maniac Mansion" type of games.

To a certain extent the existing weapon system works. I have a few problems ... I was wondering if some of you can suggest solutions for given problems.

:arrow: Pros
:!: Allows me to equip any given tool.
:!: I've writen a script so I can cycle through my slots using the TAB key which is what I want. (would allow for more than 10 slots)

:arrow: Cons/Problems:
:!: Only 10 Slots are allowed, if my script looks for slot 10 the game crashes.
:!: I can't figure out a way to check if a slot is empty.
:!: I can't figure out a way to check which current slot is active.

Posted: Sun Aug 20, 2006 3:25 am
by Fallen
Fallen wrote: :!: Only 10 Slots are allowed, if my script looks for slot 10 the game crashes.
To get more weapons slots is easy enough:

Open install/control.ini

and add weapons in this section:

Code: Select all

weapon0 = true
weapon1 = true
weapon2 = true
weapon3 = true
weapon4 = true
weapon5 = true
weapon6 = true
weapon7 = true
weapon8 = true
weapon9 = true
ex:

Code: Select all

weapon10 = true
weapon11 = true ... and so on.
-------------------------------------------------
Fallen wrote: :!: I can't figure out a way to check if a slot is empty.
You can do this by checking if the...

Code: Select all

GetAttribute("weapon_in_that_slots_name","player"); 
...is greater than 0 ... and if it is obviously there is something in that slot ... but is this the best way?

Posted: Fri Sep 01, 2006 2:42 pm
by Juutis
Sorry for not replying earlier, I kinda missed this topic.


Ok, so what is it exactly you are trying to do? Make the weapons in RF work as 'tools'? I'm sorry but I'm not familiar with the games you mentioned.


To add more weapons you don't have to touch the control.ini file. Just add the weapons in weapon.ini and define 'slot' to 10, 11, 12 etc...
I think you can have up to 40 different weapons (or tools in your case).

You can then check if a weapon is armed with self.player_weapon, which returns the slot of the currently armed weapon. You can also arm a certain weapon with the SetPlayerWeapon() command.

Could you explain a bit? Maybe then I could help more. :)