Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → Running ai?
Running ai?
2003-11-04, 11:55 AM #1
Hi!
How do I make an Actor run? I've tried AISetMoveSpeed(ai,2 or 1.5) and SetActorExtraSpeed(ai,5). No run animation. HELP!

/Edward
Edward's Cognative Hazards
2003-11-06, 3:29 AM #2
Does it have a run animation defined in its puppet file?

------------------
-Blessed Be-
I know it's the last day on earth,
We'll be together while the planet dies.

DBZ: The Destruction is Real
-Hell Raiser
2003-11-06, 4:34 AM #3
Hi there [http://forums.massassi.net/html/smile.gif]

Umm... I take it that (hopefully) you're not actually using the symbol keyword "ai", because that could be one potential flaw... [http://forums.massassi.net/html/wink.gif]

Other than that, I've noticed that none of the character actors perform "running" all to well (but they manage to do it, when you force pull a weapon)... interesting *starts to delve a little bit deeper into charcter cogs, AI and puppet files...* [http://forums.massassi.net/html/wink.gif]

As Hell Raiser mentions, I dare-say there's something related to the puppet file, somewhere along the line... I've just yet to find it, at the moment [http://forums.massassi.net/html/wink.gif]

Hope this helps [http://forums.massassi.net/html/biggrin.gif]

-Jackpot

------------------
Are you feeling lucky, cuz if you are, get your hands off me... ;)

"Life is mostly froth and bubble,
But two things stand in stone,
Kindness in another's trouble,
Courage in your own"
("Ye Wearie Wayfarer" - by Adam Lindsay Gordon)
"lucky_jackpot is the smily god..." -gothicX
"Life is mostly froth and bubble, but two things stand in stone,
Kindness in another's trouble, courage in your own"
- "Ye Wearie Wayfarer"
|| AI Builder: compatible with both JK & MotS || My website ||
2003-11-06, 9:00 PM #4
The actors I've set these for are Men, Women, and Grans. I know they can run cause I gave them a SetThingVel when created. And from the view I have, when they come thrusting into view, they start off running but then slow down. I do see the running animation, but the go over to walking almost imedietly...
Edward's Cognative Hazards
2003-11-07, 1:39 PM #5
That's just silly. SetThingVel?!

The best way to make an actor move is with AiSetMovePos(thing ref,vector); or AiSetMoveThing(thing ref, chase thing);

and

AiSetLookPos(thing ref,vector);

The code would be something like this:

Code:
AISetMoveSpeed(ai,2);
AiSetMoveThing(ai,MoveThing); 
AiSetLookPos(ai,GetThingPos(MoveThing)); 


Or, if you just want the AI to run forward,

Code:
startup:
SetPulse(0.05);
return;
pulse:
MoveTo=FireProjectile(ai,nullshot,0,0,'0 1 0',0,0,0,1,1); 
AISetMoveSpeed(ai,2);
AiSetMoveThing(ai,MoveTo); 
AiSetLookPos(ai,GetThingPos(MoveTo)); 
return;


This requires that you make a template for nullshot that has a very short timer, no model or a homemade null model, no damage, no collision, and no velocity. But the actor will always run forwards, forever and ever.

Just note, I'm not exactly sure on whether the code will work or not, I don't have any of my old reference material here.

You can easily modify this code to make the actor behave in an almost animalistic way, trying to get to certain objectives by avoiding walls and such. I've made some very good pathfinding AI that way. Think BEAM robots, only more complex.

------------------
His pot is blacker than his kettle!

Phoenix Swords
"And lo, let us open up into the holy book of Proxy2..." -genk
His pot is blacker than his kettle!
2003-11-08, 1:55 AM #6
Well, I only used SetThingVel to get the people into view. Did you know that if an AI is outside the view, it won't react to the AISetMove{Pos,Thing}?

Anyway, this is the code I have.
Code:
# The big audience running!
#
# By Edward
symbols

message		startup
message		pulse
message		entered

thing		place0
thing		place1
thing		place2
thing		place3
thing		place4
thing		place5
thing		place6
thing		place7
thing		place8
thing		place9
thing		place10
thing		place11
thing		place12
thing		place13
thing		place14
thing		place15
thing		place16
thing		place17
thing		place18
thing		place19
thing		place20
thing		place21
thing		place22
thing		place23
thing		place24
thing		place25
thing		place26

template	type0
template	type1
template	type2
template	type3
template	type4
template	type5
template	type6
template	type7
template	type8
template	type9
template	type10
template	type11
template	type12
template	type13
template	type14
template	type15

sector		ender0		mask=0xFFF
sector		ender1		mask=0xFFF
sector		ender2		mask=0xFFF
sector		ender3		mask=0xFFF

thing		i		local

int		z		local

end
#
code
startup:
	SetPulse(0.25);
return;
pulse:
	i=CreateThing(type0[rand()*15],place0[rand()*26]);
	CaptureThing(i);
	SetThingVel(i,'0 -1 0');
	AISetMode(i, 0x2000);
	sleep(0.05);
	AISetMoveSpeed(i,2);
	AISetMovePos(i,VectorSet((rand()*2.00)-1.00,-7,0));
	sleep(0.05);
	SetActorExtraSpeed(i, 5);
return;
entered:
	for(z=0; z<4; z=z+1) {
	If(GetSenderRef()==ender0[z]) {
	DestroyThing(GetSourceRef()); } }
return;
end

What I'm aiming for here is panicing people running away from a big something rather!
Edward's Cognative Hazards

↑ Up to the top!