#(DarkScript Help) Make a consumable that gives you bolts (ammo).

97 messages · Page 1 of 1 (latest)

real valley
#

(DarkScript Help) Make a consumable that gives you bolts (ammo).

#

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.

real valley
#

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)

vernal oxide
#

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.

real valley
#

$Event(505000, Default, function(X0_4, X4_4) {
WaitFor(CharacterHasSpEffect(10000, 500500));
ClearSpEffect(10000,500500);
AwardItemLot(52200000);
RestartEvent();
});

#

Thank u

#

Let me test it

vernal oxide
#

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

real valley
#

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();
});

vernal oxide
#

Put a display banner at the top of the event and another different display banner right after the waitfor

real valley
#

DisplayBanner(0);
$Event(505000, Default, function() {
DisplayBanner(0);
WaitFor(CharacterHasSpEffect(10000, 500500));
AwardItemLot(52200000);
ClearSpEffect(10000,500500);
RestartEvent();
});

#

This?

vernal oxide
#

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

real valley
#

Nothing yet

vernal oxide
#

Did you warp or quit the game after making the script changes?

real valley
#

Yep, alt f4 each time

vernal oxide
#

So if no banner displays this initialization is not working

#

Can you send me what you’re doing there?

real valley
#

To test it out i dont have any ammo, just the custom bolt with 0 and the item

vernal oxide
#

Where is this line:
InitializeEvent(0, 505000, 0);

real valley
#

line 362

vernal oxide
#

Looks good to me, hmmm

#

No banner shows up at all?

real valley
#

no

#

it does the animation and nothing

#

burns one item

#

and is that it

#

let me record it

vernal oxide
#

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?

real valley
#

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

vernal oxide
#

It shows both?

real valley
#

yea

vernal oxide
#

Well that’s good

#

Now for the awarditemlot

#

Change it to Awarditemlot(10000255)

real valley
#

Ok it worked

vernal oxide
#

Nice, good job!

#

You can delete the display banners of course

real valley
#

Can u explain to me where this 10000255 came?

vernal oxide
real valley
#

Ok, doesn't work again

vernal oxide
#

It’s the id of your itemlot

real valley
#

oh got it

vernal oxide
#

I messed up previously and told you to award the equipitemparamid

#

Well as long as it works

#

Neat idea, little bonus ammo packs

real valley
#

U can use one time, if u try again u cant use it again

#

let me record it

#

Why it just stop working? tf?

vernal oxide
#

I dunno, the event should restart exactly the same way

real valley
vernal oxide
#

Both banners show every time you use it though?

vernal oxide
#

Maybe something with the itemlot is set up to be one time only?

real valley
#

let me test with a new character then

vernal oxide
#

Compare your itemlot param for your item with something we know can be picked up multiple times, like rowa fruit

real valley
#

if is one time use only it should work again but with a new character

vernal oxide
#

The compare params feature is very helpful with something like this

real valley
#

i think that u are right

vernal oxide
#

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

real valley
#

IT WORKS

#

now to remove the banners i just leave as 0 right?

real valley
#

now is time to make bullets for guns hehe

#

trying to make guns in ER

vernal oxide
real valley
#

Since u can't reload the max ammo will be your magazine, your real ammo count will be these pouches

vernal oxide
#

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

real valley
#

but too much hastle

vernal oxide
#

Yeah, I’ve seen a few people do that too

#

But good job, cool idea!

real valley
#
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);
});
vernal oxide
#

That looks good for a one time award