Jump to content
Sign in to follow this  
Al Simmons

Carry Addon release

Recommended Posts

I think that magazines are a lot better. You can drop your item anytime, while dummy weapon cant be seen in inventory.

@Dr.Pepper: Yeah, thats true - you cant use hasWeapon command. But there are other ways, how to find out, if you have that item. Dont believe me? Try this

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Private ["_man","_item","_has_it"];

_man = _this select 0;

_item = _this select 1;

_has_it = false;

{if (_x==_item) then {_has_it = true}} foreach (magazines _man);

_has_it

Save it as check_item.sqf. Run it with

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_item_bool = [man_name,item_name] Call Loadfile "check_item.sqf"

If _item_bool returns false, unit doesnt have searched item, if it return true, unit has it.

sample

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_item_bool = [player,"M16"] Call Loadfile "check_item.sqf"

?(_item_bool):hint "You still have M16 magazine!"

?!(_item_bool):hint "You have no M16 magazines!"

Not sure, if this will work, havent tried it (Im not on my PC, where I have OFP). Maybe I made some mistake ...

Share this post


Link to post
Share on other sites

I haven't mission edited for a long time, but couldn't you do this?

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

blah.sqs

----------------

#loop

_cigcount = player count magazines "cigarette"

~0.1

?_cigcount <= 0 : goto "finish"

?_cigcount >= 1 : addAction ["Smoke Cigarette ("("format %1",_cigcount) Left)", smoke_ciggy.sqs]

~5

goto "loop"

#finish

exit

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

smoke_ciggy.sqs

----------------

player switchmove "ciganim"

~6

player switchmove " "

end

Share this post


Link to post
Share on other sites

Nope smile_o.gif

This is bad syntax

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_cigcount = player count magazines "cigarette"

Good syntax should look like this

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_cigcount = count magazines player

But it will return you only count of all magazines.

Share this post


Link to post
Share on other sites

Ok, my bad, but magazines returns the array of names of magazines, could't you check if there are any mags the array?

Share this post


Link to post
Share on other sites
I think that magazines are a lot better. You can drop your item anytime, while dummy weapon cant be seen in inventory.

@Dr.Pepper: Yeah, thats true - you cant use hasWeapon command. But there are other ways, how to find out, if you have that item. Dont believe me? Try this

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">Private ["_man","_item","_has_it"];

_man = _this select 0;

_item = _this select 1;

_has_it = false;

{if (_x==_item) then {_has_it = true}} foreach (magazines _man);

_has_it

Save it as check_item.sqf. Run it with

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_item_bool = [man_name,item_name] Call Loadfile "check_item.sqf"

If _item_bool returns false, unit doesnt have searched item, if it return true, unit has it.

sample

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_item_bool = [player,"M16"] Call Loadfile "check_item.sqf"

?(_item_bool):hint "You still have M16 magazine!"

?!(_item_bool):hint "You have no M16 magazines!"

Not sure, if this will work, havent tried it (Im not on my PC, where I have OFP). Maybe I made some mistake ...

hmm, well.

your scripts are nice, but we want to produce an addon that...

1. is easy to use for mission makers (with no need for them to script very much...if possible)

2. has the weapons-inventory and the items-inventory seperated and independent (a visible inventory for the items is planed via dialogue... and no you won´t be able to carry tenthousand things)

How could you create the condition

@ (player hasweapon "dummyweapon")

with your scripts? You´ll need a loop, that checks the magazines repeatly all the time, don´t you?

I admit I´m not the scripting-master, so every advice will be appreciated.

Share this post


Link to post
Share on other sites

Hm you got true. But I forgot on one very useful command and theres no need to script! biggrin_o.gif (script works too, but its much more complicated)

If you want to wait until player get the item, just type this

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@("Name_of_item" in (magazines player))

Ok, ok, its Al Simons and yours choice, Im just suggesting ...

Share this post


Link to post
Share on other sites

I see. That´s a good thing. Seems Lester´s Comref is not complete. I´ll look at the OFPEC comref in future...

But now that we are using a sepereted inventory system it doesn´t really matter, if you use weapon or magazine to define the items.

Or did I miss a thing again ?

Share this post


Link to post
Share on other sites
Hm you got true. But I forgot on one very useful command and theres no need to script! biggrin_o.gif (script works too, but its much more complicated)

If you want to wait until player get the item, just type this

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@("Name_of_item" in (magazines player))

Ok, ok, its Al Simons and yours choice, Im just suggesting ...

i tried it but it doesnt work

Share this post


Link to post
Share on other sites

I tried it and ... I see - really it doesnt work. After some experimenting I found the reason - OFP distinguishs (is it the right word? Its from dictionary smile_o.gif ) small and large letters.

So if you will add player blueprint of AH64 (its class name is "AS_BPah64") and check if he has it by

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@("as_bpah64" in (magazines player))

it wont work.

This is the right syntax

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@("AS_BPah64" in (magazines player))

Share this post


Link to post
Share on other sites

Dr.Pepper and me decided to overwork the whole system. Iam sure you will find it usefull.

Share this post


Link to post
Share on other sites

Hey Al,

do you think it sould be possible to make a carriable gas can?

It would be exactly like the barrels in the game except this time you can bring the barrel (gas can) to the car that is in need of fuel.

Just drop the can by the car. Then get in the car and select the refuel option (you may not even have to get in the car to activate it)....

Okay that's my random thought for you.

---IceFLYER

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×