Project X Forums
http://px.worms2d.info/forum/

Safe Surrender
http://px.worms2d.info/forum/viewtopic.php?f=13&t=456
Page 1 of 1

Author:  Slugachu [ Wed Jul 25, 2012 3:14 am ]
Post subject:  Safe Surrender

For a while, even before having project x, I was annoyed by how easy it is to use surrender by accident so I made this script. It stops players from accidentally surrendering by changing surrender so that you need to hold control while pressing space. If you are not holding control while surrendering, the message "Hold control and press space to surrender." will appear and your turn will not be wasted.

To use the script, mark the library SafeSurrender.pxl in your scheme. Then find Surrender in weapon table 1, check "Use from library", and replace Surrender with the new one.

Updated again, Final update.

Attachments:
File comment: lib
SafeSurrender.7z [481 Bytes]
Downloaded 690 times

Author:  Twicken [ Thu Jul 26, 2012 7:56 am ]
Post subject:  Re: Safe Surrender

ah very nice. good work

Author:  StepS [ Thu Jul 26, 2012 7:39 pm ]
Post subject:  Re: Safe Surrender

Sorry but your script contains an unsynchronized IsKeyPressed boolean which will desync online and in replays.
Also you missed a } at the end of file. (sometimes the test compiler doesn't detect that)

Here is how it should be:

Code:
require utils;

void script_safesurrender::Init()
{
    keySync->AddKey(17);
}

override void CWorm::FireFinal(CWeapon* Weap,CShootDesc* Desc)
{
    if (Weap->CheckName("Surrender") && keySync->KeyPressed(17)) super;
    else if (Weap->CheckName("Surrender")) {ShowMessage("Hold control and press space to surrender."); return;}
    else super;
}

Author:  Slugachu [ Thu Jul 26, 2012 8:26 pm ]
Post subject:  Re: Safe Surrender

I changed the script and re-uploaded the file. Thank you for correcting the script StepS. I'm still new with project x and this is my first script. I appreciate the help.

Author:  Twicken [ Sun Oct 07, 2012 8:35 am ]
Post subject:  Re: Safe Surrender

This script is so good. i hope you don't mind if i made a safe kamikaze version of it too for highlander(strategic)?

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/