Inventory - differently

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
Fallen
Posts: 36
Joined: Mon Jul 17, 2006 3:41 pm
Location: Waxhaw, NC

Inventory - differently

Post 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.
Last edited by Fallen on Sun Aug 20, 2006 3:28 am, edited 1 time in total.
User avatar
Fallen
Posts: 36
Joined: Mon Jul 17, 2006 3:41 pm
Location: Waxhaw, NC

Post 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?
Last edited by Fallen on Sun Aug 20, 2006 3:44 am, edited 1 time in total.
Witty comment.
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Post 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. :)
Pain is only psychological.
Post Reply