[ACS] [solved] Scripts sometimes fail to activate properly.

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
buu342
 
Posts: 58
Joined: Tue Nov 08, 2016 11:23 pm
Location: Earth

[ACS] [solved] Scripts sometimes fail to activate properly.

#1

Post by buu342 » Thu Jan 05, 2017 9:39 pm

Hi there.

I'm making a Minigame wad, and I've been having some issues with some minigames' ACS, or rather the way that the ACS is being activated.
The map is in Doom in Hexen Format.

In one minigame, an ACS Script is supposed to activate when shot at. The RailGun from Skulltag is being used as the weapon, the linedef that activates the script has both repeatable action and "Projectile Hits or Crosses" selected. In Singleplayer, the script activates all the time no problem, but in Multiplayer it fails occasionally. I've tried making the railgun shoot both a bullet along with the rail and a super fast, ripping projectile. Regardless, they both still have the failure issue.

In Another minigame, the player is teleported out of the Hub, is placed in an arena, and then teleported back into the hub once the minigame is complete. To accomplish this, I force a mapspot on the players' coords, teleport them using thing_move, then teleport them back with thing_move onto that mapspot. This works MOST of the time, but there are rare 1% chances which cause the player to not teleport back. Here's the teleportation code:

Code: Select all

// When the Game Starts, The Player's TID is set to be 1337+PlayerNumber()

//Before Round Starts in an activator based script
SpawnSpotForced("MapSpot",1337+PlayerNumber(),2337+PlayerNumber(),0);

//When the Round ends in a world-activated script which controls the minigames.
int i;
for (i=0;i<MAXPLAYERS;i++)
{
	thing_move(1337+i,2337+i,false);
	thing_remove(2337+i);
}
Last issue, in some minigames, the player must cross a lindef which activates a script which sets a variable on the player allowing them to pass. However, sometimes they fail for some players, while work fine for others. Yes, they have Repeatable Action selected and they have Player Walks Over selected too. I've even gone as far as to split them into multiple lindefs that are 1 unit long and I essentially create a massive line with 1 unit long linedefs, but again there are some people who rarely fail the game.

Again, these all work flawlessly in SinglePlayer. Could lag be a factor in this? Perhaps a known bug that'll be fixed in 3.0?

Thank you!
Last edited by buu342 on Sat Jan 07, 2017 7:41 pm, edited 1 time in total.
Remember that you are unique, just like everyone else.

User avatar
jdagenet
Forum Regular
Posts: 191
Joined: Tue Jun 05, 2012 8:08 am
Clan: Cube
Clan Tag: A3
Contact:

[ACS] Re: Scripts sometimes fail to activate properly.

#2

Post by jdagenet » Thu Jan 05, 2017 11:51 pm

There's no need to spawn a literal "MapSpot" in order to teleport and move players around. In a case like this, I would get and store the player's X, Y, and Z coordinates in an array and then use SetActorPosition to move them around. Much more efficient this way.

In online scenarios, always make sure you use some form of the "ExecuteAlways" ACS functions when running scripts.

To clarify for a fact that the script isn't running when it should be, place Log functions throughout the script and see if you notice it stopping somewhere (primarily before the for loop).

User avatar
buu342
 
Posts: 58
Joined: Tue Nov 08, 2016 11:23 pm
Location: Earth

[ACS] Re: Scripts sometimes fail to activate properly.

#3

Post by buu342 » Fri Jan 06, 2017 5:26 pm

Oh shoot, I didn't realize that there was an Execute Always for linedefs. That was silly of me not to check, thank you!

I'll try the SetActorPosition method and report back. Going to upload a new version and test it out with the ExecuteAlways implemented.

Edit:

It's all fixed. Thank you!
Remember that you are unique, just like everyone else.

Post Reply