#(DarkScript Help) Make a consumable that gives you bolts (ammo).
97 messages · Page 1 of 1 (latest)
I am trying to make a consumable that is that gives you bolts when u use it.
The consumable will be on the crafting menu, for the materials it will be needed bolts to be crafted.
Why am i doing a item that rewards bolts but need bolts to be done? To bypass the max ammo amount.
As far as i know i need to make an item that gives one SpEffectId and tell the game that when this SpEffectId is on the player, it gives the amount of bolts and remove the SpEffectId.
But i don't have much knowledge about DarkScript
This is what i have done.
EquipParamGoods
850 - CustomBolt Ammo
(Reference ID: 500500)
SpEffectsParam
500500 - CustomBolt Ammo
(Duration: 10)
EquipParamWeapon
52200000 - Custom Bolt
ItemLotParam_map
10000255 - Custom Bolt
(lotItemId01: 52200000)
(lotItemNum01: 30)
In common.emevd make a new event and initialize it. It will essentially be:
WaitFor(HasSpEffect(10000, 500500));
ClearSpEffect(10000,500500);
AwardItemLot(52200000);
RestartEvent();
I may have gotten some of the function names wrong since I’m writing this on my phone, but double check with the documentation and I think this’ll work for you.
$Event(505000, Default, function(X0_4, X4_4) {
WaitFor(CharacterHasSpEffect(10000, 500500));
ClearSpEffect(10000,500500);
AwardItemLot(52200000);
RestartEvent();
});
Thank u
Let me test it
I think you can delete the X4_4 from the parameters, since you’re not using it
Nothing is passed in from the initialization
But that’s just nitpicking
Didn't work
(and i indeed put the Initialization on top)
InitializeEvent(0, 505000, 0);
$Event(505000, Default, function(X0_4, X4_4) {
WaitFor(CharacterHasSpEffect(10000, 500500));
AwardItemLot(52200000);
ClearSpEffect(10000,500500);
RestartEvent();
});
Put a display banner at the top of the event and another different display banner right after the waitfor
DisplayBanner(0);
$Event(505000, Default, function() {
DisplayBanner(0);
WaitFor(CharacterHasSpEffect(10000, 500500));
AwardItemLot(52200000);
ClearSpEffect(10000,500500);
RestartEvent();
});
This?
No,
$Event(505000, Default, function() {
DisplayBanner(22);
WaitFor(CharacterHasSpEffect(10000, 500500));
DisplayBanner(26);
AwardItemLot(52200000);
ClearSpEffect(10000,500500);
RestartEvent();
});
Map found should always display, or something is wrong with the initialization, great rune restored should show if the script identifies the speffect on the player
We’re just using them to debug what’s wrong
Nothing yet
Did you warp or quit the game after making the script changes?
Yep, alt f4 each time
So if no banner displays this initialization is not working
Can you send me what you’re doing there?
Where is this line:
InitializeEvent(0, 505000, 0);
line 362
no
it does the animation and nothing
burns one item
and is that it
let me record it
Well the first banner should show up on level load
It has nothing to do with the item
It’s just making sure the event begins
If it’s not showing up, the custom event isn’t running
Do you have multiple mods on your computer and you’re editing one that modengine isn’t loading?
what that worked? IDK
i restarted my computer and now the script works
I was going to clean ram to record (pc on for 24H+)
it shows the banners, but doesnt give me any item yet
It shows both?
yea
Ok it worked
Can u explain to me where this 10000255 came?
Ok, doesn't work again
It’s the id of your itemlot
oh got it
I messed up previously and told you to award the equipitemparamid
Well as long as it works
Neat idea, little bonus ammo packs
U can use one time, if u try again u cant use it again
let me record it
Why it just stop working? tf?
I dunno, the event should restart exactly the same way
Both banners show every time you use it though?
yes
Maybe something with the itemlot is set up to be one time only?
hmmm
let me test with a new character then
Compare your itemlot param for your item with something we know can be picked up multiple times, like rowa fruit
if is one time use only it should work again but with a new character
The compare params feature is very helpful with something like this
i think that u are right
Right click a rowa fruit itemlot param row and click compare and view it side by side with your new item lot
And see what stands out
exacly that
now is time to make bullets for guns hehe
btw @vernal oxide
This is why i am doing this
trying to make guns in ER
Just delete the displaybanner lines entirely
Since u can't reload the max ammo will be your magazine, your real ammo count will be these pouches
Nice, that’s smart, that magic shotgun looks fun too
A lot of people implement infinite ammo scripts as well when making ranged weapons like these
Which is pretty similar to what you just did
infinite ammo nah
I thought about making use FP and use the magic as ammo instead
but too much hastle
InitializeEvent(0, <yourEventID>, <eventflagID>, <itemlotId>, <spEffectID>);
$Event(<yourEventID>, Default, function(X0_4, X4_4, X8_4) {
EndIf(EventFlag(X0_4));
WaitFor(CharacterHasSpEffect(10000, X8_4));
AwardItemsIncludingClients(X4_4);
SetEventFlag(X0_4, 1);
});
That looks good for a one time award