Project X Forums



It is currently Sun May 12, 2024 11:46 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Safe Surrender
PostPosted: Wed Jul 25, 2012 3:14 am 
Offline

Joined: Mon Jul 23, 2012 3:23 am
Posts: 3
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 471 times


Last edited by Slugachu on Thu Jul 26, 2012 8:24 pm, edited 1 time in total.
Top
 Profile  
Reply with quote  
 Post subject: Re: Safe Surrender
PostPosted: Thu Jul 26, 2012 7:56 am 
Offline
User avatar

Joined: Tue Oct 04, 2011 2:44 pm
Posts: 294
ah very nice. good work

_________________
“If you can't explain it simply, you don't understand it well enough” - Albert Einstein.


Top
 Profile  
Reply with quote  
 Post subject: Re: Safe Surrender
PostPosted: Thu Jul 26, 2012 7:39 pm 
Offline
User avatar

Joined: Sat Nov 27, 2010 12:59 pm
Posts: 346
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;
}


Top
 Profile  
Reply with quote  
 Post subject: Re: Safe Surrender
PostPosted: Thu Jul 26, 2012 8:26 pm 
Offline

Joined: Mon Jul 23, 2012 3:23 am
Posts: 3
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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Safe Surrender
PostPosted: Sun Oct 07, 2012 8:35 am 
Offline
User avatar

Joined: Tue Oct 04, 2011 2:44 pm
Posts: 294
This script is so good. i hope you don't mind if i made a safe kamikaze version of it too for highlander(strategic)?

_________________
“If you can't explain it simply, you don't understand it well enough” - Albert Einstein.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 75 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Skin by Lucas Kane