How can I start preview mode with no items (start over)?

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
rovaira
Posts: 2
Joined: Wed Jan 07, 2015 6:21 am

How can I start preview mode with no items (start over)?

Post by rovaira »

Hello.

How can I start preview mode with no items in preview mode? It keeps giving me my items I got from last time I played my own dungeon. I need to retest to see how hard/easy it is. Thank you.
cameronC
Posts: 80
Joined: Wed Apr 11, 2012 10:54 pm

Re: How can I start preview mode with no items (start over)?

Post by cameronC »

I believe the only way is to exit to main menu and click Dungeon Editor and load your mod again. I'm, generally, not a fan of it either.
Writer and sometimes artist of the very slightly acclaimed comic series Scrambled Circuits. A comic series about a robot written by a human.

Grimrock 2 socketSystem: viewtopic.php?f=22&t=8546 / Github
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: How can I start preview mode with no items (start over)?

Post by JohnWordsworth »

I guess you could add a script entity that simply runs through each slot for each champion and destroys every item they are carrying? Should only be a few lines of Lua code.

You might need to write your code in a function and use delayedCall with a time of 0.01 seconds or something to make it work as I think the inventory is reset after all script entities are run.

I am on my phone at the moment, but something like this should work...

Code: Select all

function clearInventory()
  for i=1,4 do
    local champ = party.party:getChampion(i);

    for j=1,32 do
      local e = champ:getItem(j);

      if e ~= nil then
        champ:removeItem(e);
        e.go:destroy();
      end
    end
  end
end

delayedCall(self.go.id, 0.01, "clearInventory")
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
Mal85
Posts: 103
Joined: Fri Nov 16, 2012 10:56 am

Re: How can I start preview mode with no items (start over)?

Post by Mal85 »

Throw all your items on the ground then just click the play button again to reload the session in the editor. The items on the ground will be gone, but if your also looking to reset the experience and levels I just reload the editor.
User avatar
TheStoryteller01
Posts: 20
Joined: Wed Dec 31, 2014 3:29 am
Contact:

Re: How can I start preview mode with no items (start over)?

Post by TheStoryteller01 »

I use a script on a floor triger under the starting position that empties the inventory - but I still have to restart the editor as soon as it gets too dark to test the environment : /
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: How can I start preview mode with no items (start over)?

Post by JohnWordsworth »

By "too dark", I presume you are just referring to the time of day? If you have the console enabled, you can change the time of day using...

Code: Select all

GameMode.setTimeOfDay(time)
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
Isaac
Posts: 3189
Joined: Fri Mar 02, 2012 10:02 pm

Re: How can I start preview mode with no items (start over)?

Post by Isaac »

I wish the editor had a check-box that enables or disables this new behavior. It does have its benefits, but there are times when one wishes to turn it off.
Batty
Posts: 509
Joined: Sun Apr 15, 2012 7:04 pm

Re: How can I start preview mode with no items (start over)?

Post by Batty »

I agree, this feature seems bizarre to me and would be terrific if it could be disabled.
Post Reply