Randomize on load.

Started by KodiakBehr, Fri 15/03/2013 02:32:06

Previous topic - Next topic

KodiakBehr

Okay, this is a fun question.

Is there any way I can randomize something upon the loading of a save-game?  I want to prevent players from being able to brute-force a solution.

Thanks!

Gilbert

You can detect whether a savegame is loaded by checking for the event eEventRestoreGame in the on_event() global function.

Just do something like below in the global script:
Code: AGS

function on_event(EventType event, int data){
  if (event == eEventRestoreGame) {
    //randomise codes here
  }
}

KodiakBehr

Fantastic.  Thank you kindly!

amateurhour

Also you're evil for doing this : )
Co-Founder of Pink Pineapple Ink Pink Pineapple Ink
Creator of the online comic Trouble Ticket Trouble Ticket

Snarky

You should at least give players some warning (i.e. putting in some visual cue when the puzzle re-randomizes itself). Otherwise players are liable to get stuck because of the meta-logic rather than on the puzzle itself.

Crimson Wizard

No warning, only hardcore. This must be in every game XD.

SMF spam blocked by CleanTalk