Page 1 of 2
enableEnemy
Posted: Fri May 21, 2004 3:19 am
by Krane
Dunno if it's a bots forum or a script forum but here it goes:
I'm spawning a bot and asking him to do stuff:
spawn_sci1:
local.sci1 = spawn human/multiplayer_german_dorf2_scientist.tik "targetname" "scientist1"
local.sci1 origin "808 -544 -768"
waitframe
$scientist1.enableEnemy = 0 // <-- SEE?
$scientist1 thread chalkboard
$scientist1 waittill death
wait 1
goto spawn_sci1
end
As you can see, if he dies, he spawns again. It's working but when he respawns, he is reacting to enemies. Dunno why the line is not working for the 2nd time...
Any ideas why?
Posted: Fri May 21, 2004 3:54 am
by Krane
Hmm, I made some progress. I changed my thread to this:
spawn_sci1:
local.sci1 = spawn human/multiplayer_german_dorf2_scientist.tik "targetname" "scientist1" "origin" "808 -544 -768"
waitframe
local.sci1.enableEnemy = 0
local.sci1 thread chalkboard
local.sci1 waittill death
wait 1
goto spawn_sci1
end
Now, they don't react to me (as an enemy), as long as I don't touch him

If itouch him, he goes into attack mode...
Posted: Fri May 21, 2004 6:31 am
by jv_map
That's odd.. he shouldn't attack you at all... try setting his hearing and sight to 0 and his enemysharerange to 1

dead
Posted: Fri May 21, 2004 7:55 am
by tltrude
My guess would be that the second spawn has an index number because the first one, although dead, is still using the targetname.
Re: dead
Posted: Fri May 21, 2004 8:06 am
by Krane
tltrude wrote:My guess would be that the second spawn has an index number because the first one, although dead, is still using the targetname.
Yes, sir! That's what I was thinking... There's something strange when I kill him while the previous dead body is still on the floor...and sometimes I touch him and he don't react...I said sometimes...
And jv, that solution came into my mind but that's not what I want exactly...But I'll do this if nothing else works.
Posted: Fri May 21, 2004 11:51 am
by bdbodger
can haveing a E in local.sci1.enableEnemy = 0 instead of e be causeing a problem ?
Posted: Fri May 21, 2004 1:03 pm
by jv_map
Nope I don 't think so. For a check, type g_entinfo 1 in console and you should see a big 'DISABLED' text above the AI's head

Posted: Fri May 21, 2004 2:10 pm
by lizardkid
jv, where do you get all these amazing commands? g_entinfo, g_gametype, etc. how do you know all this?
and i'm serious, do you study g_allclasses or something?
Posted: Fri May 21, 2004 3:07 pm
by jv_map
Yup g_allclasses.html pretty much tells you what you can and can't do with scripting... also take a look at the cvar docs over at
www.ritualistic.com 
(games->fakk2->editing).
SDK
Posted: Fri May 21, 2004 4:00 pm
by tltrude
Why are you using the older one? The spearhead SDK came with one that is 2 years newer (2002). It has both versions of the cvar doc combined.
SDK\docs\MOH_game_commands_and_variables.html
For Actors::
G_entinfo 1
Green Line is between the actor?s centroid and his m_vHome position
Green circle represents his leash distance away from his home position
Red circle is his m_fMinDistance
Blue circle is his m_fMaxDistance
G_entinfo 2
Red circle is his hearing
Blue circle is his sight
G_entinfo 4 ? show all actors all the time
Cvar Documentation
NOTE: The CVAR documentation was created from an earlier iteration of the engine. Approximately 95% of the commands still work for MOHTA and are therefore valid.
- Version 1.1, June 16, 2002
- Version 1.0, March 6, 2000
Posted: Fri May 21, 2004 4:46 pm
by Krane
G_entinfo is cheat protected

...So I'llhave to put cheats on the game? buuaa'...I don't even know how to do it...I heard about putting something on the shortcut of the game, but there's any other easy way to do it?
Posted: Fri May 21, 2004 4:57 pm
by jv_map
Nope... you'll have to go the shortcut-way
Anyway I'm pretty confident the 'e' is not the problem

Posted: Fri May 21, 2004 5:44 pm
by lizardkid
how do you un-cheat protect stuff like cg_3rd_person and r_showtris 2? i'm trying to change the allied model to a paratrooper but since the sleeve is all but identical to stock dude, i can't tell unless i use 3rd person view...
Posted: Fri May 21, 2004 5:57 pm
by jv_map
Add this to your shortcut:
+set thereisnomonkey 1 +set cheats 1 +set developer 1
And then start the map with devmap

Posted: Fri May 21, 2004 6:04 pm
by lizardkid
aha, devmap. thnx jv! i thought a server i went to blew my "cheats" (cg_3rd_person, r_showtris, etc.) away so i'd need to reinstall, again.