Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

my problem is here: I want to check whether global boolean variable is true or false in one of my customPawn's function.

For simplicity, let's say that I want bots to kill me when I enter the room without greeting. So in this case I would need to store somewhere variable didGreet, it should be changed when I send message "Hello" and than when any pawn sees me, he will check didGreet variable and if this was false he would start firing at me. Hope it is clear enough what I need.

I've heard that this should be done using gameInfo class, but unfortunately I don't know how to create, access and change variables there.

THX

share|improve this question
add comment

1 Answer

Is your game only going to be single-player, or are you planning to have multiple players? Since the attribute you are wanting to record is 'per player' (eg; one player greeting the bots does not mean all players have greeted the bots) - then this kind of variable should be stored in your playercontroller class. In a singleplayer game, it is quite acceptable to store such variables in your gameinfo class instead.

If you need to know how to do this, I recommend going through some unrealscript tutorials, there are quite a few out there! Good luck.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.