Raised This Month: $7 Target: $400
 1% 

Darkness/luminance in the room


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KWo
AMX Mod X Beta Tester
Join Date: Jul 2004
Location: Poland
Old 03-23-2008 , 05:50   Darkness/luminance in the room
Reply With Quote #1

How can I recognize in the bot code I'm in the dark room, so I need to use flashlight or evetually night-google? I need this to include in podbot mm code. The people are complaining the bots aren't affected at all by the darkness, but I cannot find the way how it can be done. I was thinking it's some kind of screenfade messages, but they aren't used for that. Can anybody help with this?
__________________
The Fullpack of podbot mm V3B22 - 24 apr 2012!!! is available here.
The All-In-One 3.2a package - 02 jun 2013 (AMX X 1.8.2 [with ATAC 3.0.1b , CSDM2.1.3c beta, CM OE 0.6.5, podbot mm V3B22c and mm 1.20) is available here.
The newest Beta V3B23a (rel. 28 august 2018!!!) is available here.
KWo is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-23-2008 , 06:49   Re: Darkness/luminance in the room
Reply With Quote #2

I'm not sure that i get the point fully but...

1. Check light_level pev value to get the light level of a spot of the given entity.
2. And then if necessary add EF_DIMLIGHT to effects pev value of the given entity to activate its flashlight.
VEN is offline
KWo
AMX Mod X Beta Tester
Join Date: Jul 2004
Location: Poland
Old 03-23-2008 , 07:38   Re: Darkness/luminance in the room
Reply With Quote #3

light_level seems to be not affected by the light on the player's entity (all the time it shows 128 ). But I have discovered that "blending" is changing (the second parameter of it). I don't know yet how. 116 it was in very light room. 121 it was in the very dark room. When that room has some light it was 127..133. Semi-lighted it was about 135. But that 116 for very light room confuses me. Probably it should be checked with the first parameter.
EF_DIMLIGHT lets me recognize someone is using the flishlight (so he can be seen by the bot). Anyway thanks for the help.
__________________
The Fullpack of podbot mm V3B22 - 24 apr 2012!!! is available here.
The All-In-One 3.2a package - 02 jun 2013 (AMX X 1.8.2 [with ATAC 3.0.1b , CSDM2.1.3c beta, CM OE 0.6.5, podbot mm V3B22c and mm 1.20) is available here.
The newest Beta V3B23a (rel. 28 august 2018!!!) is available here.
KWo is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 03-23-2008 , 14:19   Re: Darkness/luminance in the room
Reply With Quote #4

Quote:
light_level seems to be not affected by the light on the player's entity
I tested it on default map with lamps(tunnell) and sun(open air) - it works fine for me.
VEN is offline
KWo
AMX Mod X Beta Tester
Join Date: Jul 2004
Location: Poland
Old 03-23-2008 , 14:26   Re: Darkness/luminance in the room
Reply With Quote #5

I was testing it on cs_house map. There is a house with a lot of light-switches. No matter how many lights was on or off (even fully light or full dark) - it was always 128 on my player's entity.
The blending thing also sucks - unfortunatelly...

[EDIT]
After last steam update I cannot play in offline mode anymore, so I did first tests with light_level with CS1.5 and it wasn't working. But just now I've tested it on CS1.6 (connected to the internet) and it works! Damn Valve...
Thanks again, VEN.
[/EDIT]
__________________
The Fullpack of podbot mm V3B22 - 24 apr 2012!!! is available here.
The All-In-One 3.2a package - 02 jun 2013 (AMX X 1.8.2 [with ATAC 3.0.1b , CSDM2.1.3c beta, CM OE 0.6.5, podbot mm V3B22c and mm 1.20) is available here.
The newest Beta V3B23a (rel. 28 august 2018!!!) is available here.

Last edited by KWo; 03-23-2008 at 14:44.
KWo is offline
KWo
AMX Mod X Beta Tester
Join Date: Jul 2004
Location: Poland
Old 03-24-2008 , 14:08   Re: Darkness/luminance in the room
Reply With Quote #6

OK - after doing more tests with CS1.6 I can say so - for bots that light_level is always 0. It works correctly for human players, but the bots have always it 0, so I still need a help with this.
__________________
The Fullpack of podbot mm V3B22 - 24 apr 2012!!! is available here.
The All-In-One 3.2a package - 02 jun 2013 (AMX X 1.8.2 [with ATAC 3.0.1b , CSDM2.1.3c beta, CM OE 0.6.5, podbot mm V3B22c and mm 1.20) is available here.
The newest Beta V3B23a (rel. 28 august 2018!!!) is available here.
KWo is offline
Orangutanz
Veteran Member
Join Date: Apr 2006
Old 03-24-2008 , 14:27   Re: Darkness/luminance in the room
Reply With Quote #7

KWo where have you been? Don't you talk to anyone at BU anymore?

Bots for some strange reason do not alter light_level (bug by Valve), there is a trick that can be performed for bots however...

You need to create entities that sit inside of the bot, these are affected by light_level believe it or not.


Cheers,

Orang
__________________
|<-- Retired from everything Small/Pawn related -->|
You know when you've been Rango'd
Orangutanz is offline
KWo
AMX Mod X Beta Tester
Join Date: Jul 2004
Location: Poland
Old 03-24-2008 , 15:10   Re: Darkness/luminance in the room
Reply With Quote #8

Most of the bot coders at BU forum doesn't develope their bots anymore, so it's hard to talk to anybody...
Thanks for the tip - I'm going to research some existing codes of RealBot, JoeBot and RACC.
__________________
The Fullpack of podbot mm V3B22 - 24 apr 2012!!! is available here.
The All-In-One 3.2a package - 02 jun 2013 (AMX X 1.8.2 [with ATAC 3.0.1b , CSDM2.1.3c beta, CM OE 0.6.5, podbot mm V3B22c and mm 1.20) is available here.
The newest Beta V3B23a (rel. 28 august 2018!!!) is available here.
KWo is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 04-12-2008 , 06:48   Re: Darkness/luminance in the room
Reply With Quote #9

There are also
Quote:
engfunc(EngFunc_GetEntityIllum, Ent)
ExecuteHam(Ham_Illumination, Ent)
But it doesn't work for bots as well (for real players it's ok).

I tried to fool HL engine by setting real player's pev flags for bots and then run this functions but no luck.

Also thought that it's related to
Quote:
virtual BOOL IsPlayer( void ) { return TRUE; } // Spectators should return FALSE for this, they aren't "players" as far as game logic is concerned
virtual BOOL IsNetClient( void ) { return TRUE; } // Bots should return FALSE for this, they can't receive NET messages
But such return values is equal for real players and bots.

I also thought about InfoKeyValue *bot value but IIRC not all bots use it so i highly doubt that HL Engine would use it to do a cheks for fake clients.

Last edited by VEN; 04-12-2008 at 06:58.
VEN is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 04-12-2008 , 07:24   Re: Darkness/luminance in the room
Reply With Quote #10

I think this is the best way...
Quote:
Originally Posted by Orangutanz View Post
You need to create entities that sit inside of the bot, these are affected by light_level believe it or not.
When a bot spawn for first time, make a invisible ent, attach it to bot then check the light_level for that ent...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:26.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode