Sign in to follow this  
Followers 0

LAN game ENTER script problem

So basically I have a script that gives a brief explanation of what class the player is playing. The script works offline but if someone plays a LAN game with a friend then the script treats both players as 1 and gives both players an explanation for both classes their playing rather than each player getting a separate message only for their class.

Basically I want the script check only 1 players inventory at a time and gives them a message depending on the class their playing, rather than the script checking both inventories at the same time then playing a script to both players as if they are playing as 2 classes at once.


Here is the script, if anyone could help me out I would be very grateful.

Spoiler

script 28 ENTER
{
Fadeto(0,0,0,1.0,0.001);
if (CheckInventory("IAMNECRO") == 1)
{
Thing_Move (0, 49,1);
delay(15);
acs_execute(29,0,0,0,0);
}
if (CheckInventory("IAMCLERIC") == 1)
{
Thing_Move (0, 58,1);
SetFont("BIGFONT");
HudMessage(s:"As A cleric you can cast searing light every 20 seconds which increases your weapon damage and heals you.";
HUDMSG_FADEOUT, 1, CR_RED, 0.5, 0.4, 8.0);
delay(250);
}
if (CheckInventory("IAMMAGE") == 1)
{
Thing_Move (0, 60,1);
SetFont("BIGFONT");
HudMessage(s:"As A Mage you gain 1 blue mana every 10 seconds, this effect lasts forever.";
HUDMSG_FADEOUT, 1, CR_RED, 0.5, 0.4, 8.0);
delay(250);
}
if (CheckInventory("IAMFIGHTER") == 1)
{
Thing_Move (0, 59,1);
SetFont("BIGFONT");
HudMessage(s:"As A Fighter you regenerate 1 health every 10 seconds, this effect lasts forever.";
HUDMSG_FADEOUT, 1, CR_RED, 0.5, 0.4, 8.0);
delay(250);
}
delay(15);
Fadeto(0,0,0,0.0,1.0);

}


script 29 (void)
{
delay(65);
Fadeto(0,0,0,0.7,0.001);
SetFont("BIGFONT");
HudMessage(s:"Necromancers can use their secondary attack to summon minions.";
HUDMSG_FADEOUT, 1, CR_RED, 0.5, 0.4, 8.0);
delay(250);
HudMessage(s:"All necromancer weapons can summon minions but cost health to summon them.";
HUDMSG_FADEOUT, 1, CR_RED, 0.5, 0.4, 8.0);
delay(250);
HudMessage(s:"Necromancer minions last about 1 minute before dying.";
HUDMSG_FADEOUT, 1, CR_RED, 0.5, 0.4, 7.0);
delay(220);
HudMessage(s:"Necromancers gain 4 health whenever they kill a monster but minions give no health.";
HUDMSG_FADEOUT, 1, CR_RED, 0.5, 0.4, 8.0);
delay(250);
Fadeto(0,0,0,0.0,1.0);
}

Share this post


Link to post

Unless a player somehow manages to obtain two of the 'IAMCLASS' items, i don't see why the script would behave like that.

You could modify the script so that it would only give one class description for a player, though they may get the wrong one
if they do indeed have more than one 'IAMCLASS'.

- - - - - - - - - - - - - - - - - - - - - - - - - -

For this part:

if (CheckInventory("IAMNECRO") == 1)
{
Thing_Move (0, 49,1);
delay(15);
acs_execute(29,0,0,0,0);
}

If two players were to go necro, it may cause a problem since acs_execute wont fire if the script is already active.

Using acs_executealways instead will allow multiple instances of the same script to run, so that the script could work for each player.

http://zdoom.org/wiki/ACS_ExecuteAlways

Hope i helped a little.

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  
Followers 0