How to add a store?

  • Offline Doyle
  • Fresh Spawn
  • *
  • Posts: 12

How to add a store?

« posted: Apr 20, 2014, 01:28 AM »
Hey,

So, i've been trying my best to copy and reproduce using the scripts provided in the mission, however when attempting to I get: "Type Script, expected nothing."

I've been looking around, but have gotten no straight answer, so how exactly can I implement a NPC to access the Vehicle Shop Menu?

Thanks,

~Doyle
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2314

Re: Vehicle Shop (How-to?)

« Reply #1 posted: Apr 21, 2014, 07:01 AM »
EDIT: updated for Eden

To create any store:

First, you gotta load the mission in the editor, and place a civilian unit somewhere. Put it exactly where you want it, preferably inside a building; it will keep its original position and rotation. Just note that a desk will spawn in front of it, so make sure it's not too close to a wall.

Give it a name, depending on which type of store do you want: "GenStoreX", "GunStoreX", "VehStoreX". Replace the X with a number, it can be anything you want as long as it's unique for that type of store. Personally, I prefer to keep them ordered, so for Altis there are GenStore1 to 5, GunStore1 to 4, and VehStore1 to 4.

Then, you must set the Object Init of the unit to the following:

Code: [Select]
0 = [this] spawn A3W_fnc_setupStoreNPC
You can save the mission. Now, you will need to open mapConfig\storeOwners.sqf, and add entries in storeOwnerConfig and storeOwnerConfigAppearance.

The storeOwnerConfig entry should look like this:

Code: [Select]
["VehStoreX", -1, [], ["Boats", "Planes"]],

Change the X to your chosen number. The second and third parameters are obsolete values used for positioning in the past before Eden, keep them at -1 and []. The fourth parameter is an array to designate the buttons you want to exclude from that store, if there are no appropriate spawns. "Boats" and "Planes" will hide those buttons from the store menu.

Next, the storeOwnerConfigAppearance should look like this:

Code: [Select]
["VehStoreX", [["weapon", ""], ["uniform", "U_IG_Guerilla3_2"]]],

Change the X to your chosen number, and make sure all entries end with a comma except the last one. The weapon option is if you want your store NPC to wield a weapon, just put the classname in the empty spot. The second option is the uniform the NPC should wear, again just change the classname to your liking.

Pay attention to the commas; all entries should have one at the end, except the last one.

Last but not least, open up the editor again. You will need to set up markers where to spawn purchased objects. For general and gun stores, you need a marker named "GenStoreX_objSpawn" or "GunStoreX_objSpawn", again replacing the X'es. This should be placed on the road in front of the store building entrance.

For vehicles stores, there are: "VehStoreX_landSpawn" for land vehicles, "VehStoreX_seaSpawn" for boats and submarines, "VehStoreX_heliSpawn" for helicopters, and "VehStoreX_planeSpawn" for planes, again replacing the X'es. Make sure you set the planeSpawn rotation towards the direction for takeoff. landSpawn and heliSpawn are mandatory, you can omit seaSpawn if you have disabled boats, and planeSpawn if you disabled planes. Once those markers are placed, save the mission, copy-paste the SQM into your working directory if needed, and it should be good to go.
  • Offline Doyle
  • Fresh Spawn
  • *
  • Posts: 12

Re: Vehicle Shop (How-to?)

« Reply #2 posted: Apr 26, 2014, 12:44 AM »
Hey!

I know I should probably make a new thread for this, but since you're already here, I have another question.

The Donator Rank? I've been looking for the use of it, and as per what I want to be setup, I would like to limit a certain shop / NPC to Donator only access, is there anyway that is possible, and if so, how would one do something of the likes?

Thanks for everything,

~Doyle
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2314

Re: Vehicle Shop (How-to?)

« Reply #3 posted: Apr 26, 2014, 01:33 AM »
The "donator" thing was removed in the last update. It was simply a feature to allow people using the KoS web donation system to obtain more money on spawn. No one else ever used it besides KoS, hence why it was removed.
  • Offline Doyle
  • Fresh Spawn
  • *
  • Posts: 12

Re: Vehicle Shop (How-to?)

« Reply #4 posted: Apr 26, 2014, 11:51 PM »
The "donator" thing was removed in the last update. It was simply a feature to allow people using the KoS web donation system to obtain more money on spawn. No one else ever used it besides KoS, hence why it was removed.
So, that being said, is there any way to get a Donation System up for something like that, or was that completely removed?

~Doyle
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2314

Re: Vehicle Shop (How-to?)

« Reply #5 posted: Apr 27, 2014, 12:00 AM »
So, that being said, is there any way to get a Donation System up for something like that, or was that completely removed?

~Doyle

There never was a complete donation system in the first place, all it was was a property containing 0 or 1 in the player save, indicating whether or not this person has donated, and a config option for how much money a donator would receive on spawn.

I have already made a donation system long ago for another game, and it's definitely not simple. You need a Business or Premier Paypal account, then you have to set up your Instant Payment Notification settings to contact a URL onto a web server of yours with custom-made code that will save which player has donated somewhere. That somewhere has to be readable from the game server, then you would be able to find if someone has donated.

Things like that don't fall from the sky in a ready-to-go package. If you have no experience in web development, you'll most likely have to find or hire someone who can make it happen.
  • Offline Doyle
  • Fresh Spawn
  • *
  • Posts: 12

Re: Vehicle Shop (How-to?)

« Reply #6 posted: Apr 27, 2014, 12:15 AM »
So, that being said, is there any way to get a Donation System up for something like that, or was that completely removed?

~Doyle

There never was a complete donation system in the first place, all it was was a property containing 0 or 1 in the player save, indicating whether or not this person has donated, and a config option for how much money a donator would receive on spawn.

I have already made a donation system in the past that interacted with a Call of Duty server (back when there were rentable dedis), and it's definitely not simple. You need a Business or Premier Paypal account, then you have to set up your Instant Payment Notification settings to contact a URL onto a web server of yours with custom-made code that will save which player has donated somewhere. That somewhere has to be readable from the game server, then you would be able to find if someone has donated.

Things like that don't fall from the sky in a ready-to-go package. If you have no experience in web development, you'll most likely have to find or hire someone who can make it happen.
Would their be a way to implement the old "Donation System" into v0.9f?

Thanks,

~Doyle
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2314

Re: Vehicle Shop (How-to?)

« Reply #7 posted: Apr 27, 2014, 12:19 AM »
Would their be a way to implement the old "Donation System" into v0.9f?

Thanks,

~Doyle

You mean to put back in what was removed?
  • Offline Doyle
  • Fresh Spawn
  • *
  • Posts: 12

Re: Vehicle Shop (How-to?)

« Reply #8 posted: Apr 27, 2014, 12:23 AM »
Would their be a way to implement the old "Donation System" into v0.9f?

Thanks,

~Doyle

You mean to put back in what was removed?
Yes, I was looking through previous versions, but I couldn't exactly "find" it.

~Doyle
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2314

Re: Vehicle Shop (How-to?)

« Reply #9 posted: Apr 27, 2014, 12:26 AM »
Yes, I was looking through previous versions, but I couldn't exactly "find" it.

~Doyle

If I put a Donator 0 or 1 property in the player save and a "isDonator" boolean in the player object, would that be sufficient for you?
  • Offline Doyle
  • Fresh Spawn
  • *
  • Posts: 12

Re: Vehicle Shop (How-to?)

« Reply #10 posted: Apr 27, 2014, 12:30 AM »
Yes, I was looking through previous versions, but I couldn't exactly "find" it.

~Doyle

If I put a Donator 0 or 1 property in the player save and a "isDonator" boolean in the player object, would that be sufficient for you?
Yes, that would :).

I'm sorry I seem like such a complete idiot here, just trying to get this setup!

~Doyle
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2314

Re: Vehicle Shop (How-to?)

« Reply #11 posted: Apr 27, 2014, 06:10 AM »
There you go: https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/commit/156e259

All you have to do is set  Donator=1  under  [PlayerInfo]  in a player save, and in your code you can use the following to check if the player is a donator:

Code: [Select]
if (player getVariable ["isDonator", false]) then
{
// do stuff
};
  • Offline Doyle
  • Fresh Spawn
  • *
  • Posts: 12

Re: Vehicle Shop (How-to?)

« Reply #12 posted: Apr 27, 2014, 04:28 PM »
There you go: https://github.com/A3Wasteland/ArmA3_Wasteland.Altis/commit/156e259

All you have to do is set  Donator=1  under  [PlayerInfo]  in a player save, and in your code you can use the following to check if the player is a donator:

Code: [Select]
if (player getVariable ["isDonator", false]) then
{
// do stuff
};
Hey!

So I added the three files into the Persistence Folder, now where do I put that (that being the code for "isDonator")?
c_savePlayerData.sqf ?

~Doyle
  • Offline AgentRev
  • Developer
  • Veteran
  • ******
  • Posts: 2314

Re: Vehicle Shop (How-to?)

« Reply #13 posted: Apr 27, 2014, 06:21 PM »
Hey!

So I added the three files into the Persistence Folder, now where do I put that (that being the code for "isDonator")?
c_savePlayerData.sqf ?

~Doyle

What do you mean? The code is for you do whatever you want with it.
  • Offline Doyle
  • Fresh Spawn
  • *
  • Posts: 12

Re: Vehicle Shop (How-to?)

« Reply #14 posted: Apr 27, 2014, 07:33 PM »
Hey!

So I added the three files into the Persistence Folder, now where do I put that (that being the code for "isDonator")?
c_savePlayerData.sqf ?

~Doyle

What do you mean? The code is for you do whatever you want with it.
Ah! Awesome, experimenting with this now. :)

~Doyle