I'm making him run a thread:
while (is_enemy_visible == 0)
{
self holster
}
end
Needless to say it's not working...
Help
Moderator: Moderators
Code: Select all
while(isAlive self)
{
if(isAlive self.enemy && self cansee self.enemy 4000 90)
self unholster
else
self holster
waitframe
}
Code: Select all
while(isAlive self)
{
? if!(isAlive self.enemy && self cansee self.enemy 4000 90)
? ? self holster
? else
? ? self unholster
? waitframe
} Code: Select all
while(isAlive self)
{
if!(isAlive self.enemy && self cansee self.enemy 4000 90)
self gun "weapons/p38.tik"
else
self gun "weapons/kar98.tik"
waitframe
}
Code: Select all
while(isAlive self)
{
if!(isAlive self.enemy && self cansee self.enemy 4000 90)
self weapon "walter p38"
else
self weapon "mauser kar 98k"
waitframe
}
Code: Select all
while(isAlive self)
{
if !(isAlive self.enemy && self cansee self.enemy 4000 90)
{
self weapon "walter p38"
while (isAlive self && !(isAlive self.enemy && self cansee self.enemy 4000 90))
waitframe
}
else
{
self weapon "mauser kar 98k"
while (isAlive self && isAlive self.enemy && self cansee self.enemy 4000 90)
waitframe
}
//waitframe // shouldn't need this no more :)
}
Looks like, if you give them the command "holster", they forget about this part of the tikserver
{
classname Actor
german
setsize "-16 -16 0" "16 16 92"
health 100
weapon "Walter P38"
}
Nice try but you're making a fundamental mistakeKrane wrote:Jv, the first method indeed makes the fps drop and the second don't! why? simple!
Suppose I tell you: "Jv, call me if you feel sick and I'll help you!". I'm asking you to check for the condition "feel sick". You'll check yourself to see if you're feeling sick (jv:"hmm, I'm fine right now, so I'm not gonna call Krane")
Now, suppose I tell you: "Jv, If you DON'T feel sick. DON'T call me!". You are going to check if you're NOT sick (jv:"hmm, this is the case, I'm feeling fine!") and you're going to "not-call"( whatever this action is) me every frame! Got it? Every frame you'll perform an action, instead of not doing anything every frame!
If you tell the bots: " If you see an enemy, unholster!" they will unholster only if they see you. But if you tell him: "If you don't see an enemy (which HAPPENS every frame) holster".they will holster (or every other action u tell they to do) EVERY FRAME!!!!
I'm not good on explanations but this makes a lot of sense for me!
Code: Select all
while(isAlive self)
{
if !(isAlive self.enemy && self cansee self.enemy 4000 90)
{
self weapon "walter p38"
while (isAlive self && !(isAlive self.enemy && self cansee self.enemy 4000 90))
waitframe
}
else
{
self weapon "mauser kar 98k"
while (isAlive self && isAlive self.enemy && self cansee self.enemy 4000 90)
waitframe
}
//waitframe // shouldn't need this no more :)
}
But I think when I come too close to them, they were changing to pistols
routine_1:
self thread awareness
self holster
while(isalive self)
{
//all the s*** here
}
end
Nana, if the first condition is met, they unholster but if the 2nd condition is met, the do nothing...That were pretty visible, they were walking like the had parkinson or so...loljv_map wrote:Nice try but you're making a fundamental mistakeBoth methods discussed will do either the 'holster' or 'unholster' command every frame...