Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
basically it's just a bunch of
"GetInventory().CreateInInventory('");"
for everything, clothes, items, etc. Before everything I have "player.RemoveAllItems();" to hopefully take everything out. I've also removed the tactical shirt. So basically I'm wondering how to add stuff in the jacket and vest, and if I can't, how can I spawn stuff around the player?
One more question, is there a way to add multiples of something? Like instead of 3 lines putting a pistol mag in the inventory can I do something like "x.quantity(3);"?
itemEnt = player.GetInventory().CreateInInventory("AthleticShoes_Black"); itemBs = ItemBase.Cast(itemEnt);
pGun = player.GetInventory().CreateInInventory("MP5K"); itemBs = ItemBase.Cast(itemEnt); // added the gun before any backpacks so attachments would be added to the gun and not in the players inventory
itemEnt = player.GetInventory().CreateInInventory("MP5_RailHndgrd"); itemBs = ItemBase.Cast(itemEnt); //doing this before adding inventory spaces ensured the attachment was on the gun by default
itemEnt = player.GetInventory().CreateInInventory("MP5k_StockBttstck"); itemBs = ItemBase.Cast(itemEnt); // same thing with the buttstock for the gun
itemEnt = player.GetInventory().CreateInInventory("MP5_Compensator"); itemBs = ItemBase.Cast(itemEnt); // and the compensator
itemEnt = player.GetInventory().CreateInInventory("BoonieHat_Black"); itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("TrackSuitJacket_Black"); itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("TrackSuitPants_Black"); itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd"); itemBs = ItemBase.Cast(itemEnt); // note that when spawnin players with mags, they are full by default
player.SetQuickBarEntityShortcut(itemEnt, 1, true);
itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd"); itemBs = ItemBase.Cast(itemEnt);
player.SetQuickBarEntityShortcut(itemEnt, 2, true);
itemEnt = player.GetInventory().CreateInInventory("Mag_MP5_30Rnd"); itemBs = ItemBase.Cast(itemEnt);
player.SetQuickBarEntityShortcut(itemEnt, 3, true);
itemEnt = player.GetInventory().CreateInInventory("Ammo_9x19"); itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("HighCapacityVest_Black"); itemBs = ItemBase.Cast(itemEnt);
itemEnt = player.GetInventory().CreateInInventory("TacticalBaconCan_Opened"); itemBs = ItemBase.Cast(itemEnt);
player.SetQuickBarEntityShortcut(pGun, 0, true);
break;
Thanks, I’ll take a look when I get home, been a while since I used loadout scripts so not sure if the code I was using still works.
Initially looking at this all the items just end up in the inventory correct ??
you also appear to have some excess lines such as:
where if you just removed the rand = Math from the first set of foods you would not need the second set and have it read:
Or even:
However the above FoodArray will only pick from one of the food items.
Note: i'm only glancing over your init file right now as i'm still working so forgive any formatting or typos i've made in my examples.
Edit: altered typo in rndindex definitions.
I don't see where you define pGun🤔🤔🤔🤔
you have the right idea with player.RemoveAllItems(); just in the wrong place ( at least i see it as being in the wrong place as you was adding items just to remove them with that ).
If you use it here instead:
That will remove the random generated ones / chosen clothing.
On to the clothing you want, create a line space after removing the clothes and create your outfit in the same way as you are inventory items ( if you want the option of putting specific items into a backpack or something you will need to alter the way you create / add the items ).
Just adding clothing without the option of adding loot to a specific piece of clothing do:
To have the ability to set loot into a specific piece of clothing you will need to do:
so you can spawn the loot item to that location later by doing:
Edit: I can help further if you would like just add me.
Thank you Smokey, I have programmed in c for a year or two now and have taken a year of comp sci in college, I just don't know the classes and how everything is defined in DZ. Everything you've said makes sense and I think I have the basic functions down for now. If you know any useful functions, or ones you find yourself using a lot I would appreciate it if you could post them, I might find them useful, and even if I don't someone else will.
EDIT: another question, can the EntityAI class be used to attach objects to guns, such as
"EntityAI g1 = ...("FNX45");"
"itemEnt = g1...("PistolSuppressor");"
or is there another way of doing this? Unless you're on right now I'm about to figure it out for myself but it's useful to have someone who already knows lol. Thanks again, by the way. You've been a great help.
https://pastebin.com/kqR0mcr8
This is my new code, everything is working great! I did need the "remove items" inside the if condition, for some reason when its outside where you suggested it removes all items AFTER they have been placed on the character (I spawned with no items or clothes when using your suggestion, commented the line out and it worked but I had default clothes, so I moved it to the if condition and it worked). The EntityAI does work with guns, belts, everything and it's great, but if you use it with a magazine in a gun it seems to either despawn it or have no ammo, so that's staying out for now.
I will have a look at your new file shortly, the weekend is here and my attention can be split though so will take a while haha.
When it comes to adding magazines just adding them as an attachment or in any simple way bugs out the weapon and / or magazine and I suspect you also need to add ammo to the chamber for that weapon ( I was investigating this yesterday but have no solution as of yet ).
What I have been doing is this:
EntityAI G1 = player.GetInventory().CreateInInventory("");
G1.GetInventory().CreateAttachment("");
When it comes to an attachment that requires another item ( such as a light needing a battery ) create a new class with EntityAI.
Defining a class should allow for attachment of the likes of chemlights and radios to backpacks, granades to vests and even NVGs and lights, with batteries to helmets.
I may have another solution for the remove items, when I did an initial test it functioned in the place I referenced hence why I'm looking for a different overall solution to that.
Is that init file you posted last the one you intend to use as I noticed your previous one had a mosin not a SVD as the primary weapon, I only ask as I'm thinking of making you a sample, once I iron out a few things with what I'm working on that is 😂😂
https://pastebin.com/fA7QEPfL
I was just thinking instead of this:
trying something more like this:
As this would allow variation instead of the constant three food items.
If you have a random multiple character set in init.c similar to the one above, is there an easy way to spawn a random car at the player? I tried adding different cars per loadout but it doesn't seem to like it, I can only make it work on the one I had done for a single character spawn and a set car. Any help would be awesome, cheers
with just normal clothing though
for each player that joins my server
many thanks for any help as not too clever at this stuff