Jump to content

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...