bdmn@Posted: Sat Sep 25, 2010 6:00 pm : hi guys,
how to tell a turret to instantly target and shoot since an enemy (even monsters) walk in range / sight ? i played with the spawnargs, neither auto_target, triggering it, .becomeAggressive(), etc. worked for me. somebody can help me?
i just want a turret in a corner that fires on evrything thats not in his team.
thx for help
The Happy Friar@Posted: Mon Sep 27, 2010 3:17 pm : So did you trigger it to activate it or just set it up to be triggered?
bdmn@Posted: Mon Sep 27, 2010 4:32 pm : i tried trigger flag 0 and 1. i trigger it all time via sys.trigger. no difference if u trigger it with enemies around or not. auto_target 1 didnt help anyway. it only starts shooting if it gets attacked.
AnthonyJa@Posted: Mon Sep 27, 2010 10:55 pm : The SDK is again the answer to your question - although I don't have a great answer for you yet.... do you have any experience in C++? If so it'd definitely be worth you downloading the code, building it, and adding some debug info so you can figure out exactly what is happening in your case.
The possibilities I've found so far, in increasing order of likeliness:
- The ignored enemies have "notarget" = "1" in it's spawnArgs - this causes idAI::ReactTo to ignore them until they have been attacked. I suspect this isn't your issue though since the default notarget seems to be "0".
- your turret is "dormant". It looks like AI's are usually dormant until they're woken up by a player (not monster) being near (based on idEntity::DoDormantTests). Try setting "neverDormant" to "1" in the spawnArgs.
- There's something else that I've missed that would cause it to ignore it's enemies. Using C++ I'd debug this by putting a breakpoint / logging into rvMonsterTurret::State_Combat and see if it's selecting an enemy. If it isn't, then debug into CheckForEnemy to figure out why that isn't finding one when you think there should be.
bdmn@Posted: Tue Sep 28, 2010 6:08 pm : thanks for your answer, i fixed my prob few secs ago. seemed to be something messed up with the setup. thanks anyway for taking care of it. im well experienced in c/c++ but its long time ago. ive used java the last few years for my job and want to get into it again.
i already met some of those methods as i changed the ai sys a bit. but i have to work on the turrets anyway, so thanks for spoinling me some good points in the code.
AnthonyJa@Posted: Tue Sep 28, 2010 10:36 pm : Glad you've got it sorted. some people who stick to scripting don't have experience in c++ and struggle to figure things out, but running it up in a debugger with a few well placed breakpoints tends to help figure out what is going on far quicker than anything else
bdmn@Posted: Sat Sep 25, 2010 6:00 pm : hi guys,
how to tell a turret to instantly target and shoot since an enemy (even monsters) walk in range / sight ? i played with the spawnargs, neither auto_target, triggering it, .becomeAggressive(), etc. worked for me. somebody can help me?
i just want a turret in a corner that fires on evrything thats not in his team.
thx for help
The Happy Friar@Posted: Mon Sep 27, 2010 3:17 pm : So did you trigger it to activate it or just set it up to be triggered?
bdmn@Posted: Mon Sep 27, 2010 4:32 pm : i tried trigger flag 0 and 1. i trigger it all time via sys.trigger. no difference if u trigger it with enemies around or not. auto_target 1 didnt help anyway. it only starts shooting if it gets attacked.
AnthonyJa@Posted: Mon Sep 27, 2010 10:55 pm : The SDK is again the answer to your question - although I don't have a great answer for you yet.... do you have any experience in C++? If so it'd definitely be worth you downloading the code, building it, and adding some debug info so you can figure out exactly what is happening in your case.
The possibilities I've found so far, in increasing order of likeliness:
- The ignored enemies have "notarget" = "1" in it's spawnArgs - this causes idAI::ReactTo to ignore them until they have been attacked. I suspect this isn't your issue though since the default notarget seems to be "0".
- your turret is "dormant". It looks like AI's are usually dormant until they're woken up by a player (not monster) being near (based on idEntity::DoDormantTests). Try setting "neverDormant" to "1" in the spawnArgs.
- There's something else that I've missed that would cause it to ignore it's enemies. Using C++ I'd debug this by putting a breakpoint / logging into rvMonsterTurret::State_Combat and see if it's selecting an enemy. If it isn't, then debug into CheckForEnemy to figure out why that isn't finding one when you think there should be.
bdmn@Posted: Tue Sep 28, 2010 6:08 pm : thanks for your answer, i fixed my prob few secs ago. seemed to be something messed up with the setup. thanks anyway for taking care of it. im well experienced in c/c++ but its long time ago. ive used java the last few years for my job and want to get into it again.
i already met some of those methods as i changed the ai sys a bit. but i have to work on the turrets anyway, so thanks for spoinling me some good points in the code.
AnthonyJa@Posted: Tue Sep 28, 2010 10:36 pm : Glad you've got it sorted. some people who stick to scripting don't have experience in c++ and struggle to figure things out, but running it up in a debugger with a few well placed breakpoints tends to help figure out what is going on far quicker than anything else
bdmn@Posted: Sat Sep 25, 2010 6:00 pm : hi guys,
how to tell a turret to instantly target and shoot since an enemy (even monsters) walk in range / sight ? i played with the spawnargs, neither auto_target, triggering it, .becomeAggressive(), etc. worked for me. somebody can help me?
i just want a turret in a corner that fires on evrything thats not in his team.
thx for help
The Happy Friar@Posted: Mon Sep 27, 2010 3:17 pm : So did you trigger it to activate it or just set it up to be triggered?
bdmn@Posted: Mon Sep 27, 2010 4:32 pm : i tried trigger flag 0 and 1. i trigger it all time via sys.trigger. no difference if u trigger it with enemies around or not. auto_target 1 didnt help anyway. it only starts shooting if it gets attacked.
AnthonyJa@Posted: Mon Sep 27, 2010 10:55 pm : The SDK is again the answer to your question - although I don't have a great answer for you yet.... do you have any experience in C++? If so it'd definitely be worth you downloading the code, building it, and adding some debug info so you can figure out exactly what is happening in your case.
The possibilities I've found so far, in increasing order of likeliness:
- The ignored enemies have "notarget" = "1" in it's spawnArgs - this causes idAI::ReactTo to ignore them until they have been attacked. I suspect this isn't your issue though since the default notarget seems to be "0".
- your turret is "dormant". It looks like AI's are usually dormant until they're woken up by a player (not monster) being near (based on idEntity::DoDormantTests). Try setting "neverDormant" to "1" in the spawnArgs.
- There's something else that I've missed that would cause it to ignore it's enemies. Using C++ I'd debug this by putting a breakpoint / logging into rvMonsterTurret::State_Combat and see if it's selecting an enemy. If it isn't, then debug into CheckForEnemy to figure out why that isn't finding one when you think there should be.
bdmn@Posted: Tue Sep 28, 2010 6:08 pm : thanks for your answer, i fixed my prob few secs ago. seemed to be something messed up with the setup. thanks anyway for taking care of it. im well experienced in c/c++ but its long time ago. ive used java the last few years for my job and want to get into it again.
i already met some of those methods as i changed the ai sys a bit. but i have to work on the turrets anyway, so thanks for spoinling me some good points in the code.
AnthonyJa@Posted: Tue Sep 28, 2010 10:36 pm : Glad you've got it sorted. some people who stick to scripting don't have experience in c++ and struggle to figure things out, but running it up in a debugger with a few well placed breakpoints tends to help figure out what is going on far quicker than anything else