Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Doomguy94

Scripting

Recommended Posts

I am trying to make it, where items spawned depend on what skill you are playing on. When I test it on "Hey, Not too Rough" the items from "Hurt Me Plenty" appear.

Spoiler

Script 8 (void)
{
ACS_ExecuteAlways(9,0,0,0,0);
}

Script 9 (Void)
{
while (GameSkill() <= SKILL_EASY)
{
SpawnSpot("Rocketlauncher",9);
SpawnSpot("BFG9000", 10); 
SpawnSpot("plasmarifle", 11);
SpawnSpot("rocketbox", 12);
SpawnSpot("cellpack", 13);
SpawnSpot("cellpack", 14);
}
{
While (GameSkill() == SKILL_NORMAL)
SpawnSpot("Cellpack",9);
SpawnSpot("rocketbox", 10); 
SpawnSpot("cellpack", 11);
SpawnSpot("plasmarifle", 12);
SpawnSpot("chaingun", 13);
SpawnSpot("supershotgun", 14);
}
}

Share this post


Link to post

That's why you should always indent your code.

Script 9 (Void)
{
	while (GameSkill() <= SKILL_EASY)
	{
		SpawnSpot("Rocketlauncher",9);
		SpawnSpot("BFG9000", 10); 
		SpawnSpot("plasmarifle", 11);
		SpawnSpot("rocketbox", 12);
		SpawnSpot("cellpack", 13);
		SpawnSpot("cellpack", 14);
	}

	while (GameSkill() == SKILL_NORMAL)
	{ // <- this brace was in a wrong place
		SpawnSpot("Cellpack",9);
		SpawnSpot("rocketbox", 10); 
		SpawnSpot("cellpack", 11);
		SpawnSpot("plasmarifle", 12);
		SpawnSpot("chaingun", 13);
		SpawnSpot("supershotgun", 14);
	}
}

Share this post


Link to post

The immediate problem is what MaxED said, your HMP check only applied to the cellpack in spot 9, but the items in spots 10-14 always spawned regardless of skill setting as they weren't conditioned.

But why do you use "while" instead of "if"?

Share this post


Link to post
Gez said:

The immediate problem is what MaxED said, your HMP check only applied to the cellpack in spot 9, but the items in spots 10-14 always spawned regardless of skill setting as they weren't conditioned.

But why do you use "while" instead of "if"?


weird, the HNTR items do not appear..

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×