Game Development Community

Checking Inventory and creating new guard.

by Shaan · in Technical Issues · 04/12/2005 (1:50 am) · 7 replies

Hi
I have searched but didnt get anything abt it.

Like health Bar and weopon, I want to collect the points from various places and by pressing any specific button, It should check the inventory and according to that allow me to create extra guard and include him in my batallion.

Could someone point me into right direction or suggest me any resouce / tutorial.

Thanx in Advance.
Ali Shikla

#1
04/12/2005 (1:56 am)
Are you talking about an RTS game? RTS starter kit would be your best bet there. at $50 bux its a steal
#2
04/13/2005 (5:41 am)
Thanx Johnson,

I tried to digged into RTS Starter Kit, but getting no help.

Actually, I m working on first person shooter game and trying to find a way to create guards by checking my inventory. If I have enough points/money, and by pressing a key it will create an ai guard to help me fight with the enimies.

I already implemented Mark Holcomb's "AI Guard Resource" into my Game and Its working fine. I also added different weapons.

Any help will be appriciate alot.

Ali Shikla
#3
04/21/2005 (1:24 am)
Hi,
I tried several things and found a simple solution which works okey to me. I took a specific item in player's Inventory such as crossbowammo and while pressing a perticular key, its creating a bot if the ammo amount is more then 50. Later on, Instead of crossbowammo, I will create a new item which will have points in players inventory. I don't know if this is reliable way to get it or not.

I would be pleased if you guyz can suggest me more appropriate way to do it.

The second problem, by pressing a key, everytime the new bot is spawning at a fix place into the mission no matter where the player is. I want the bot to spawn/create near the player and not very far from him just like the Tank works in Tank Pack.

Looking to hear u'r kind suggestion. Thanx

Ali Shikla
#4
04/24/2005 (2:46 am)
Hi, My project is fully depend on the problems I did mention in above post. I m finding bit difficult to solve. So If u guyz could help me, I will be very grateful to u.

Hoping to get u'r reply. Thanx
#5
05/02/2005 (10:40 am)
The guard's initial position is set in a datablock, right? Can't you just change that in script?

1) Get the player's location
2) Get a random vector from the player's location
3) Draw a line from that point to the ground (could be up or down)
4) use that location for the spawn point.

I'm no torque expert, but this sounds like it should work.

Thinking about this, it would have some trouble inside buildings, particularly if there was more than one story/roof. You could have your guard appear a floor or two above or below you. Oops. I suppose you could cast a ray from the player to the result of #2, and use that...

It looks like they uniformly use the "position" property... you could just tweak it to your liking after creating it. I take it you're using aiAddPlayer()?

Two options:
1) Change the datablock each time before creating the bot.
2) Change the bot after creation.



And if you've got working code in the Tank Pack, just see how they're doing it.
#6
05/30/2005 (8:37 am)
Hi Mark,
Thanx for your cool suggestions.

I checked Tank Pack and got my stuff working. Now if i press a perticular key, its checking the item's inventory and creating a new bot / guard besides me.

I m using mark Holcomb's "AIGuard resource".

But, If i use this inside a building which has more than one roof, the position of new bot is not proper. As Mark has suggested that, i could get it by casting a ray from the player position.

I did nt get that yet, so could anyone suggest me how i can achieve this. Thanx in advance for you'r kind help.
#7
06/05/2005 (6:37 am)
Check the Torque Vehicle resource - it may do something similar.