enableEnemy

Post your scripting questions / solutions here

Moderator: Moderators

Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

enableEnemy

Post 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?
Image
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post 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...
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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 :)
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

dead

Post 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.
Tom Trude,

Image
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Re: dead

Post 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... :o

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.
Image
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

can haveing a E in local.sci1.enableEnemy = 0 instead of e be causeing a problem ?
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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 :wink:
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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?
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post 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).
Image
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

SDK

Post 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
Tom Trude,

Image
Krane
Lieutenant General
Posts: 782
Joined: Sat May 31, 2003 4:18 pm
Location: California, USA
Contact:

Post by Krane »

G_entinfo is cheat protected :cry: ...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?
Image
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Nope... you'll have to go the shortcut-way :(

Anyway I'm pretty confident the 'e' is not the problem :wink:
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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...
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

Add this to your shortcut:

+set thereisnomonkey 1 +set cheats 1 +set developer 1

And then start the map with devmap :)
Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post 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.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
Post Reply