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 → Let a enemy shoot a ghost object.
Let a enemy shoot a ghost object.
2002-12-22, 6:00 AM #1
I want to make an enemy shoot at a wall in a cutscene (or a ghost near a wall what'll make it easier probably). I tried
Code:
	AISetFireTarget(PL, fireat);
	Sleep(5);
	StopThing(PL);

and later Lord Virus suggested that I added: AISetMode(PL, 0x20);
But that too didn't work. The enemy doesn't fire.
What probably would work is make a new invisable enemy template which will be a valid target, but isn't there an easier way. With coging mayhaps?
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-12-22, 6:49 AM #2
The firetarget has to be an actor. Just change type=cog to type=actor and it should work. If it doesn't, try to assign an aiclass and see what happens...

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-12-23, 5:48 AM #3
Thanks I'll try that
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-12-23, 6:15 AM #4
Bah, it didn't work [http://forums.massassi.net/html/frown.gif]
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-12-23, 6:28 AM #5
I tried letting him shoot existing AI, but that didn't work either, neither when I placed them directly at his side, so it can't bebecause it's out of range or something...
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-12-23, 7:19 AM #6
How 'bout facing him towards the ghost and using FireProjectile().

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-12-23, 8:42 AM #7
I just noticed that it does not have to be an actor. This makes holo the target for all nearby enemies:
Code:
pulse:
	holo = GetSenderRef();

	potential = FirstThingInView(holo, 270, 1, 0x4);
	while(potential != -1)
	{
		if((GetThingTemplate(potential) != hologram) && HasLOS(holo, potential) && GetActorWeapon(potential, 1) != -1)
		{
			AISetLookPos(potential, GetThingPos(holo));
			AISetMoveThing(potential, holo);
			AISetFireTarget(potential, holo);
		}
		potential = NextThingInView();
	}

	Return;

I've directly copied that from my hologram mines cog, so I can assure you that it works. Holo is the ghost and potential is an empty thing variable...as you can see, your initial try should have worked. Maybe add AISetLookPos above your initial code. Holo is a sequencer charge, by the way.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)

[This message has been edited by zagibu (edited December 23, 2002).]
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-12-26, 11:48 AM #8
Odd... Still no result...
here's the entire code, maybe I'm just making a small dumb mistake.
Code:
# 
# 
# Apt5cutscene1.cog by ZOOIkes aka Darth Vedder

symbols

message      entered                                                          
thing        cam                                                              
thing        cam2                                                             
thing        INS                                                              
thing        PL                                                               
thing        player                             local                         
thing        fireat                                                           
flex         stspeed=1.0                                                      
flex         speednormal=4.0                                                  
int          done=0                             local                         
int          firer                              local                         
int          target                             local                         
sector       entersec                                                         
keyframe     key1                                                             
keyframe     key2                                                             
sound        Conversation5                                                    
int          idle0                              local                         
int          idle1                              local                         
int          check                              local                         
int          i                                  local                         
cog          amb0                                                             
cog          amb1                                                             
cog          amb2                                                             
cog          amb3                                                             
cog          amb4                                                             
cog          amb5                                                             
end                                                                           

code
entered:
	Sleep(3.0);
	if (done) return;
	done = 1;
	// setup first 
	player = GetLocalPlayerThing(); 
	for(i = 0; i < 6; i = i + 1) SendMessage(amb0, user0);
	// switch the player for an Actor 
	SetActorFlags(player, 0xa00000); 
	StopThing(player);
	Sleep(0.5);
 	Print("-82 years ago-");
	SetCameraFocus(0, cam);
	Sleep(.5);
	MoveToFrame(cam, 1, speednormal);
	Sleep(4);
	AISetMoveSpeed(PL, stspeed);
	AISetMoveSpeed(INS, stspeed);
	Sleep(.1);
	AIClearMode(INS, 0x1000); 
	AISetLookFrame(INS, 1);
	AISetMoveFrame(INS, 1);
	AIClearMode(PL, 0x1000); 
	AISetLookFrame(PL, 1);
	AISetMoveFrame(PL, 1);
	Sleep(7);
	PlaySoundLocal(Conversation5, 1, 0, 132);	
	print("PL: Here, another mystery. Watch closely");
	Sleep(2.5);
	SetCameraFocus(0, cam2);
	Sleep(1);
	firer = PL;
	target = fireat;
	AISetLookPos(firer, GetThingPos(target));
	AISetFireTarget(firer, target);
	AISetMode(PL, 0x20);
	Sleep(5);
	StopThing(PL); 
	Idle0 = playkey(PL, key1, 1, 0x00);
	Idle1 = playkey(INS, Key2, 1, 0x00);
	SetCameraFocus(0, cam);
	Sleep(1);
	Print("INS: The walls are made of concrete but deflects the laser. How did they achieve that with their technology? With the force?");
	Sleep(5);
	Print("PL: We are still researching.");
	Sleep(2);
	Print("Ins: And with what goal? They didn't even have lasers!");
	Sleep(3);
	Print("PL: Unknown...");
	Sleep(1);
	SetCameraFocus(0, player);
	if (jkGetSaberCam() == 1)
	CycleCamera();
	// unfreeze's Kyle
	ClearActorFlags(Player, 0xa00000);
 for(i = 0; i < 6; i = i + 1) SendMessage(amb0, user1);
	return;

end


------------------
Author of: A Pirate's Tale
Mots SP
http://piazza.iae.nl/users/ceekelen/
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-12-28, 2:30 AM #9
Sorry but I'm currently not available (LAN party). Maybe GBK can go over it?

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-12-28, 5:16 AM #10
Ah, I've just fixed it, still couldn't get the firetarget thing to work, now I went with Descent's idea of just using fireprojectile. That worked, altough it looks a bit less then when aisetfiretarget would've worked. Ah well...
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-12-30, 1:08 PM #11
One last thing, now after he fires, he gets scared or something and runs away... He shouldn't move at all...
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-12-31, 6:21 AM #12
never mind, fixed it.
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com

↑ Up to the top!