Need help with the badguy1 script

Topics regarding Scripting with Reality Factory
bweinstein
Posts: 19
Joined: Sun Jun 19, 2011 6:54 am

Need help with the badguy1 script

Post by bweinstein »

I viewed the How to Make a Free First Person Shooter part 3 on youtube and tried to copy down the script in the example. When I tried using it in my game it did not work. If anyone could look at what I typed and let me know if there are any errors, that would be great. Thanks!
{
Spawn[()
{
Console(false)
AttributeOrder("enemy_health",100,"Die"):
FindTargetOrder(200,"Alert","health"):
SetFOV(360):
HostilePlayer(true):
HostileSame(false):
HostileDifferent(false):
SetGroup("Enemy"):
}]
Die[()
{
AnimateStop("die,0,0,"):
FadeOut(2,0):
Remove(true):
}]
Alert[()
{
PlayerDistorder(-800,"LostTarget")
AnimateStop("idle",0,""):
NewOrder("Attack"):
}]
Attack[()
{
RotateToPlayer("walk",160,false,""):
FireProjectile("pistol_shell", BIPO1 R FOREARM:,0,0,0
"health",""):
if(self.player_range>96)
{
MoveForward("walk",50,50,""):
}
else
Delay("hit",1,""):
}
RestartOrder():
}]
LostTarget[()
{
BlendToAnimation("idle",1,false,"")
FindTargetOrder(200,"Alert",health"")
megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: Need help with the badguy1 script

Post by megatop »

check your email i got you a present :D
bweinstein
Posts: 19
Joined: Sun Jun 19, 2011 6:54 am

Post by bweinstein »

Awesome. thanks so much!
megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: Need help with the badguy1 script

Post by megatop »

np my friend but thats the only script im giving to you i want you to under stand so you can make your own. if you make your own scripts i will be happy to edit them for you :D. I like to share.
megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: Need help with the badguy1 script

Post by megatop »

remember to give me credit if anyone ask how you got the badguy1 script hough and if the game goes pro
User avatar
Nighthawk_0973
Posts: 234
Joined: Tue Apr 19, 2011 2:08 am
Location: In front of my computer.

Re: Need help with the badguy1 script

Post by Nighthawk_0973 »

Hey I've been having trouble with the rotation for this script. The guy starts facing the floor and he shoots me and kills me way to fast. I don't even know how he can shoot me while looking at the floor facedown as if he where dead. Here's my script:

Code: Select all

{
	Spawn[()
	{
		Console(false);
		AttributeOrder("enemy_health", 100, "Die");
		FindTargetOrder(200, "Alert", "health");
		SetFOV(360);
		HostilePlayer(true);
		HostileSame(false);
		HostielDifferent(false);
		SetGroup("Enemy");
	}]
	Die[()
	{
		AnimateStop("die", 0, "");
		FadeOut(2,0);
		Remove(true);
	}]
	Alert[()
	{
		PlayerDistOrder(-800, "LostTarget");
		AnimateStop("idle", 0, "");
		NewOrder("Attack");
	}]
	Attack[()
	{
		RotateToPlayer("walk", 160, false, "");
		FireProjectile("pistol_shell", "BIP01 R FOREARM", 0, 0, 0, "health", "");
		if(self.player_range>96)
		{
			MoveForward("walk", 50, 50, "");
		}
		else
		{
			Delay("hit", 5, "");
		}
		RestartOrder();
	}]
	LostTarget[()
	{
		BlendToAnimation("idle", 1, false, "");
		FindTargetOrder(200, "Alert", "health");
	}]
}
Here's the badguy1 section of the Pawn.ini file:

Code: Select all

[badguy1]
actorname = Badguy1.act
actorotation = 270 180 0
actorscale = 1.4
fillcolor = 255 255 255
ambientcolor = 255 255 255
subjecttogravity = true
boundingboxanimation = idle
shadowsize = 64
I'm pretty sure it has something to do with the rotation. I copied it right of the How to make a first person shooter for free part 3 video by gigafide but still no luck.

Any help here my modifications don't seem to work and I can't really change to the rotation I need via Actor View as far as I know how...
https://sites.google.com/site/theneverendinguniverse/ <-- Infinite Universe Website. It's a 2D MMORPG I'm releasing into beta near the late summer (I hope :D) note: RF isn't an MMO maker. Not yet anyways.
User avatar
bernie
RF Moderator
Posts: 1249
Joined: Tue Nov 15, 2005 10:07 am
Location: Ireland

Re: Need help with the badguy1 script

Post by bernie »

[badguy1]
actorname = Badguy1.act
actorotation = 270 180 0
actorscale = 1.4
fillcolor = 255 255 255
ambientcolor = 255 255 255
subjecttogravity = true
boundingboxanimation = idle
shadowsize = 64
If he's facing the floor change this line to:
actor rotation 0 180 0
that should correct the problem i think
User avatar
Nighthawk_0973
Posts: 234
Joined: Tue Apr 19, 2011 2:08 am
Location: In front of my computer.

Re: Need help with the badguy1 script

Post by Nighthawk_0973 »

Argh! Still doesn't work. We was pointing his head to the wall and now he is pointing his head in a different direction. I tried messing with other settings but still no use...
https://sites.google.com/site/theneverendinguniverse/ <-- Infinite Universe Website. It's a 2D MMORPG I'm releasing into beta near the late summer (I hope :D) note: RF isn't an MMO maker. Not yet anyways.
megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: Need help with the badguy1 script

Post by megatop »

Hey nighthawk I had big sucsess with this script.Anyways i found your error. In the Delay("hit",5,""); it has to be Delay("hit",1,""); not 5. Hope this helps. Or just email me and ill give you the correct script. :D
User avatar
Nighthawk_0973
Posts: 234
Joined: Tue Apr 19, 2011 2:08 am
Location: In front of my computer.

Re: Need help with the badguy1 script

Post by Nighthawk_0973 »

Could you just copy and paste the Pawn.ini and the badguy1.s script into a PM for me? Thanks. :D
https://sites.google.com/site/theneverendinguniverse/ <-- Infinite Universe Website. It's a 2D MMORPG I'm releasing into beta near the late summer (I hope :D) note: RF isn't an MMO maker. Not yet anyways.
megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: Need help with the badguy1 script

Post by megatop »

no problem since im online.Ill give you the code right here right now
User avatar
Nighthawk_0973
Posts: 234
Joined: Tue Apr 19, 2011 2:08 am
Location: In front of my computer.

Re: Need help with the badguy1 script

Post by Nighthawk_0973 »

lol I just posted here so we're acually both online at the same time!
https://sites.google.com/site/theneverendinguniverse/ <-- Infinite Universe Website. It's a 2D MMORPG I'm releasing into beta near the late summer (I hope :D) note: RF isn't an MMO maker. Not yet anyways.
megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: Need help with the badguy1 script

Post by megatop »

sounds good
megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: Need help with the badguy1 script

Post by megatop »

Code: Select all

[badguy1]
actorname = badguy1.act
actorrotation = 270 180 0
actorscale = 1.4
fillcolor = 255 255 255
ambientcolor = 255 255 255
subjecttogravity = true
boundingboxanimation = idle
shadowsize = 64

Code: Select all

{
	Spawn[()
	{
		Console(false);
		AttributeOrder("enemy_health",150,"Die");
		FindTargetOrder(200,"Alert","health");
		SetFOV(360);
		HostilePlayer(true);
		HostileSame(false);
		HostileDifferent(false);
		SetGroup("Enemy");
	}]

	Die[()
	{
		AnimateStop("die",0,"");
		FadeOut(3,0);
		Remove(true);
	}]

	Alert[()
	{
		PlayerDistOrder(-800,"LostTarget");
		AnimateStop("idle",0,"");
		NewOrder("Attack");
	}]

	Attack[()
	{
		RotateToPlayer("walk",160,false,"");
		FireProjectile("pistol_shell","BIP01 R FOREARM",0,0,0,
		"health","");
		if(self.player_range>96)
		{
			MoveForward("walk",50,50,"");
		}
		else
		{
			Delay("hit",1,"");
		}
		RestartOrder();	
	}]

	LostTarget[()
	{
		BlendToAnimation("idle",1,true,"");
		FindTargetOrder(200,"Alert","health,");
	}]
}
megatop
Posts: 184
Joined: Thu Jun 02, 2011 12:36 am

Re: Need help with the badguy1 script

Post by megatop »

theres the script its not regular cause i did major updates. I updated the script to make it correct.
Post Reply