Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark Physics & Dark A.I. & Dark Dynamix / Enemy wont return to position and reinit AI Set Entity Position...

Author
Message
Mugen Wizardry
User Banned
Posted: 11th May 2010 19:15
Hi all, can someone tell me why I can't get the enemy to go to its position, back to it's original position..

then repeat the position movement?

also, why wont my enemy rotate after he comes back to his old position?

Mugen Wizardry
User Banned
Posted: 11th May 2010 20:41 Edited at: 11th May 2010 21:50
anyone?
Mugen Wizardry
User Banned
Posted: 11th May 2010 23:44
*sigh*
Dia
14
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 12th May 2010 13:59
steady on matey, these boards aren't quite instant messaging, you can't expect a response in a few hours necessarily.

secondly, that is some wierd code you got going there

check out the usage of the DarkAI commands, notably:

"AI Entity Go To Position Entity Number, Position X#, Position Z#"

DarkAI works only in the x and z coordinates, and it was only luck that your waypointx# value is the same as your AI entity number

"AI Entity Assign Patrol Path Entity Number, Path Number"

I *think* this is what you are trying to achieve, a repeated patrol of the 'enemy' block

you can set up patrol paths using 'go to position' code, but it is a sort of one-shot thing, the entity goes out to the position, then returns to its idle position.

you do not update the waypointz# variable at any point in this code, so waypointz# will always = 30 (since that is what you set it to in the declaration), meaning that the "if waypointz#=0" condition is never met

if instead you use:


the block will patrol between its initial position and z=30

I *think* that is what you are after

This is not the Sig you are looking for....
Mugen Wizardry
User Banned
Posted: 12th May 2010 15:57
It's PERFECT.

except for 1 thing..

when the "guard" returns back to his old position, he quickly rotates and moves to his new position.

How can I make it so it waits until he turns and THEN move him?

Dia
14
Years of Service
User Offline
Joined: 16th Jan 2005
Location:
Posted: 12th May 2010 16:27
Well, you could set a counter manually, but instead - do you have a copy of the compiled DarkAI help file?

check Start -> Programs -> The Game Creators -> Expansion Packs -> Dark AI -> Documentation

have a read through it, especially all the actions and set parameters. it includes this command

AI Set Entity Patrol Time Entity Number, Time#

This is not the Sig you are looking for....
Mugen Wizardry
User Banned
Posted: 12th May 2010 17:03
its still not working..

HowDo
17
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th May 2010 17:09
@Mugen Wizardry
which plugin does dist# = fml distance(X1#,Y1#,Z1#,X2#,Y2#,Z2#) come from?

Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 12th May 2010 17:13
Styx. but its not that.

i commented out that

function..
HowDo
17
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th May 2010 17:16
Just finding out where it came from so I could get your code to run, if this bit not needed then will rem it out and see if I can see how to make it go, fingers cross.

Is Styx free or do I have to buy it.

cheers.

Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 12th May 2010 17:18
u have to buy it.

so i recommend just using the distance() formula

u dont need to buy that

but its slower than styx
Mugen Wizardry
User Banned
Posted: 12th May 2010 17:20
if u need dwarf1.dbo download psionics model

then save the object as a dbo, loading it:

load object "dwarf1.x",1,1

save object "dwarf1.dbo",1

end



if not,

turn it into a cube
HowDo
17
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th May 2010 17:54
Mugen Wizardry ,well I re read what you've posted and as far as I can see its doing what you want.

1. when it start the cone I am using turns around and goes to position 30,30 it waits.
2. it then turns around and moves back to 0,0
3. the turns again and moves off to 30,30 again.

only thing I find it doing is waiting at 30,30 before going again
, is this what you are see with your model.

Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 12th May 2010 17:56
its not doing what i want.

its going to 30,30, waiting then turning then going back to 0,0.

HOWEVER.

when its at 0,0 again, it should wait, turn, then go to 30,30.

which its not doing.
HowDo
17
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th May 2010 18:08
so what you would like is when it gets back to 0,0 it should wait then move again, this what I would have thought it would do and was expecting.

Right I now know what were aiming for.

Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 12th May 2010 18:10
yea.

thats right
Mugen Wizardry
User Banned
Posted: 12th May 2010 19:11
did u find the problem?
HowDo
17
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th May 2010 19:14 Edited at: 12th May 2010 19:15
Looking at some of the demos I found this line that shows what the AI is think, when it gets to the 30,30 point is goes to idle but stays like that until it gets back to 0,0 then goes to AI Entity Go To Position.



might help when adding or removing commands to see whats going on.

Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 12th May 2010 19:22
wtf?

hes idle AND moving?

thats not right.
HowDo
17
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th May 2010 19:27
plus I found a command thats in the docs but not in the keywords looking for something to help



add this one to your keywords ini for darkAI.


plus here are few more that do not turn blue yet until to put these in



Dark Physics makes any hot drink go cold.
HowDo
17
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th May 2010 19:47
Is this Entity to be one that will Patrol or one that you control.

Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 12th May 2010 19:50
it is a guard patrol
HowDo
17
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th May 2010 20:03 Edited at: 12th May 2010 20:06
look at the Patrol demo as you need to define were its going with waypoints, as the command you are using is really a manual override to make go and come back.

edit
do you use the chm help file or would you like a help file set like the DBPro, meaning put cursor on key word then press F1 and up pop the help file for that command.

Dark Physics makes any hot drink go cold.
HowDo
17
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th May 2010 20:15 Edited at: 12th May 2010 20:19
try this




Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 12th May 2010 20:24
it works..

however for some reason, the guard only partially turns around before moving again when he goes from 30,30, to 0,0, back to 30,30
HowDo
17
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th May 2010 20:28
try upping the AI Set Entity Patrol Time 1, 3 to 6 or 8, when set to 12 the object (cube) would turn by it self.

you need to work out how long how many moves it take for you object to turn.

Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 12th May 2010 20:31
nope.

here, try this:

HowDo
17
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th May 2010 21:16
when object is loaded rotate it to 180 degrees and fix the objects pivot.

Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 12th May 2010 21:18
nope. is he SUPPOSED to look around like that before he leaves his posts?

HowDo
17
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 12th May 2010 21:24
this should do it, loaded object rotated it 180 then fixed in postion then rotated back 180 but not fixed it, object now faces you and then turns to face direction it will walk.



Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 12th May 2010 21:28
ok, is he supposed to stop then look around before he moves?

if so, then it is fixed
Mugen Wizardry
User Banned
Posted: 14th May 2010 17:23
is the object SUPPOSED to stop and look around and THEN go to his waypoint?
HowDo
17
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 14th May 2010 22:01
if you cut down AI Set Entity Patrol Time then it will not have time to look around, however in most games this makes it look more real.

Dark Physics makes any hot drink go cold.
Mugen Wizardry
User Banned
Posted: 14th May 2010 22:34
ok, so its not a malfunction?

thanks for all of your help!

i may need it in the future, so stick around buddeh!

~M.W.~
HowDo
17
Years of Service
User Offline
Joined: 28th Nov 2002
Location: United Kingdom
Posted: 14th May 2010 22:58
No worries, I find it great fun trying to find out how to make it do things we want.

just post here again or if its a new subject then make a new thread.

Dark Physics makes any hot drink go cold.

Login to post a reply

Server time is: 2019-12-08 00:10:15
Your offset time is: 2019-12-08 00:10:15