starting items

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

starting items

Post by bongobeat »

Hello guys,

I use a script to add items to the champions at the beginning (picked somewhere in the forum).
Works great in the editor, but in the game, no (no spawned items at all and no crash)!
The mystery of scripting things :lol:

Can someone help please?

I've called this script: party_item_start, and it is activated by a hidden plate (triggered by party, activate once, silent)
The party start the game on this plate.

In parallel this plate is activating a timer for a insta death square script

party_item_start:
SpoilerShow

Code: Select all

function startingItems()

local StartTunic = spawn("peasant_tunic")
party:getChampion(1):insertItem(2,StartTunic)

local StartBreeche = spawn("peasant_breeches")
party:getChampion(1):insertItem(3,StartBreeche)

local Startsandals = spawn("sandals")
party:getChampion(1):insertItem(4,Startsandals)

local Startshuriken = spawn("shuriken")
party:getChampion(1):insertItem(7,Startshuriken)

local Startglove = spawn("leather_gloves")
party:getChampion(1):insertItem(9,Startglove)
--
--
local Startcap2 = spawn("leather_cap")
party:getChampion(2):insertItem(1,Startcap2)

local StartTunic2 = spawn("peasant_tunic")
party:getChampion(2):insertItem(2,StartTunic2)

local StartBreeche2 = spawn("peasant_breeches")
party:getChampion(2):insertItem(3,StartBreeche2)

local Startsandals2 = spawn("sandals")
party:getChampion(2):insertItem(4,Startsandals2)

local Startmachete2 = spawn("machete")
party:getChampion(2):insertItem(8,Startmachete2)

local Startshield2 = spawn("legionary_shield")
party:getChampion(2):insertItem(7,Startshield2)
--
--
local StartTunic3 = spawn("peasant_tunic")
party:getChampion(3):insertItem(2,StartTunic3)

local StartBreeche3 = spawn("silk_hose")
party:getChampion(3):insertItem(3,StartBreeche3)

local Startboots3 = spawn("nomad_boots")
party:getChampion(3):insertItem(4,Startboots3)

local Startpoison3 = spawn("poison_bomb")
party:getChampion(3):insertItem(8,Startpoison3)

local Startdagger3 = spawn("dagger")
party:getChampion(3):insertItem(7,Startdagger3)
--
--
local StartTunic4 = spawn("doublet")
party:getChampion(4):insertItem(2,StartTunic4)

local StartBreeche4 = spawn("peasant_breeches")
party:getChampion(4):insertItem(3,StartBreeche4)

local Startsandals4 = spawn("sandals")
party:getChampion(4):insertItem(4,Startsandals4)

local Startwater4 = spawn("water_flask")
party:getChampion(4):insertItem(7,Startwater4)

local Startbread4 = spawn("dm_bread")
party:getChampion(4):insertItem(8,Startbread4)

end
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
leewroy
Posts: 532
Joined: Fri May 25, 2012 10:17 pm

Re: starting items

Post by leewroy »

Well, I remember an old module where you start with some stuff...pyramid of xafi, maybe?
Anyway, starting naked doesn't sound a good idea for most of the mods, so in my opinion, this will be very useful. :)
Who will explore a tomb, dungeon, temple, or whatever naked and bare handed?
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: starting items

Post by bongobeat »

Well that's true :)

that was a good idea in grimrock as prisonners, but in other mods...
anyway began naked encourages you to find secrets ;)

That's why I wanted to add that in mine, especially if you are a rescue team (naked is not serious, what a band of rookie :lol: )
Anyway beginning naked can be justified, the game start after some snow tempest, they have lost most of their equipment in the tempest :lol:
(ok, ok, I'm going to hide)
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
User avatar
Isaac
Posts: 3192
Joined: Fri Mar 02, 2012 10:02 pm

Re: starting items

Post by Isaac »

One thing is "dm_bread", unless you've defined it in the mod.

Plates can be problematic. Do you start your party on the plate?

Try this: Make a script object and paste your statements in it, but not in a function block.
*Remove or comment out the function block.

Code: Select all

--function startingItems()

    local StartTunic = spawn("peasant_tunic")
    party:getChampion(1):insertItem(2,StartTunic)

    local StartBreeche = spawn("peasant_breeches")
    party:getChampion(1):insertItem(3,StartBreeche)

    local Startsandals = spawn("sandals")
    party:getChampion(1):insertItem(4,Startsandals)

    local Startshuriken = spawn("shuriken")
    party:getChampion(1):insertItem(7,Startshuriken)

    local Startglove = spawn("leather_gloves")
    party:getChampion(1):insertItem(9,Startglove)
    --
    --
    local Startcap2 = spawn("leather_cap")
    party:getChampion(2):insertItem(1,Startcap2)

    local StartTunic2 = spawn("peasant_tunic")
    party:getChampion(2):insertItem(2,StartTunic2)

    local StartBreeche2 = spawn("peasant_breeches")
    party:getChampion(2):insertItem(3,StartBreeche2)

    local Startsandals2 = spawn("sandals")
    party:getChampion(2):insertItem(4,Startsandals2)

    local Startmachete2 = spawn("machete")
    party:getChampion(2):insertItem(8,Startmachete2)

    local Startshield2 = spawn("legionary_shield")
    party:getChampion(2):insertItem(7,Startshield2)
    --
    --
    local StartTunic3 = spawn("peasant_tunic")
    party:getChampion(3):insertItem(2,StartTunic3)

    local StartBreeche3 = spawn("silk_hose")
    party:getChampion(3):insertItem(3,StartBreeche3)

    local Startboots3 = spawn("nomad_boots")
    party:getChampion(3):insertItem(4,Startboots3)

    local Startpoison3 = spawn("poison_bomb")
    party:getChampion(3):insertItem(8,Startpoison3)

    local Startdagger3 = spawn("dagger")
    party:getChampion(3):insertItem(7,Startdagger3)
    --
    --
    local StartTunic4 = spawn("doublet")
    party:getChampion(4):insertItem(2,StartTunic4)

    local StartBreeche4 = spawn("peasant_breeches")
    party:getChampion(4):insertItem(3,StartBreeche4)

    local Startsandals4 = spawn("sandals")
    party:getChampion(4):insertItem(4,Startsandals4)

    local Startwater4 = spawn("water_flask")
    party:getChampion(4):insertItem(7,Startwater4)

   -- local Startbread4 = spawn("dm_bread")
   -- party:getChampion(4):insertItem(8,Startbread4)

--end
User avatar
msyblade
Posts: 792
Joined: Fri Oct 12, 2012 4:40 am
Location: New Mexico, USA
Contact:

Re: starting items

Post by msyblade »

I believe Isaacs solution will work. The problem you're running into is that the pad is being created at the same time as the party, so nothing "triggers" it AFTER it's created. So just run the script by default, no function to trigger. This is also how you remove the "First time playing Grimrock?" message. Just make 4 blank hudPrints (or whatever message you want to start), outside of a function.
Quite plainly:

hudPrint ""
hudPrint ""
hudPrint ""
hudPrint ""

Don't even need an end, because there is no function to run.

On another note, I've always used the "Starting Default Party" (SDP) script, found here:
viewtopic.php?f=14&t=3201&hilit=sdp+party

It works great for me, allows you to simply choose all Names, genders, races, classes, abilities, and items to start with. Even Ranger can be in a party of 4 this way (Although everyone won't move faster).
Currently conspiring with many modders on the "Legends of the Northern Realms"project.

"You have been captured by a psychopathic diety who needs a new plaything to torture."
Hotel Hades
bongobeat
Posts: 1076
Joined: Thu May 16, 2013 5:58 pm
Location: France

Re: starting items

Post by bongobeat »

msyblade wrote:I believe Isaacs solution will work. The problem you're running into is that the pad is being created at the same time as the party, so nothing "triggers" it AFTER it's created. So just run the script by default, no function to trigger. This is also how you remove the "First time playing Grimrock?" message. Just make 4 blank hudPrints (or whatever message you want to start), outside of a function.
Quite plainly:

hudPrint ""
hudPrint ""
hudPrint ""
hudPrint ""

Don't even need an end, because there is no function to run.

On another note, I've always used the "Starting Default Party" (SDP) script, found here:
viewtopic.php?f=14&t=3201&hilit=sdp+party

It works great for me, allows you to simply choose all Names, genders, races, classes, abilities, and items to start with. Even Ranger can be in a party of 4 this way (Although everyone won't move faster).
Isaac wrote:One thing is "dm_bread", unless you've defined it in the mod.

Plates can be problematic. Do you start your party on the plate?

Try this: Make a script object and paste your statements in it, but not in a function block.
*Remove or comment out the function block.
Thanks all for your help.

yes I start on a hidden plate
the dm_bread is a custom item from germany's donjon master pack.

Works now with your solution, I ve added the starting items script after the 4 blank hudprint! :)
I did not thought about adding lines here! thanks, very simple ;)

I remember now the SDP, but I forgot it :?
My asset pack: viewtopic.php?f=22&t=9320

Log1 mod : Toorum Manor: viewtopic.php?f=14&t=5505
Post Reply