Player starts with Inv...Properties Flag vs Game_Start

Started by Knox, Wed 12/05/2010 04:03:54

Previous topic - Next topic

Knox

For learning purposes, I was wondering what the main difference is between adding an inventory item in game_start within the global script vs. setting the option "player starts with item" to "true" in the item's property box.

Code: ags
function game_start()
{
  //Add Default Inventory items
  player.AddInventory(iWatch);
}


Is one way "better" or "faster"  than the other or are  they equally the same in terms of memory/computation (which I doubt would be very much anyways since its pretty simple).

Im guessing its the same thing?
--All that is necessary for evil to triumph is for good men to do nothing.

Dualnames

Quote from: general_knox on Wed 12/05/2010 04:03:54
For learning purposes, I was wondering what the main difference is between adding an inventory item in game_start within the global script vs. setting the option "player starts with item" to "true" in the item's property box.

Code: ags
function game_start()
{
  //Add Default Inventory items
  player.AddInventory(iWatch);
}


Is one way "better" or "faster"  than the other or are  they equally the same in terms of memory/computation (which I doubt would be very much anyways since its pretty simple).

Im guessing its the same thing?

It's the same thing. I just prefer to do set the property of the inventory, as it's easier and faster to beta-test sth. Also imagine starting with like 100 inventory items, it'd be a pain in the ass to do it there. Or it wouldn't be possible if you want a quantity over 1 of an item.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

Knox

Ah ok, thats what I thought. True, once you have a lot of items it will be pretty long to add them that way in the script.
--All that is necessary for evil to triumph is for good men to do nothing.

SMF spam blocked by CleanTalk