Jump to content

Recommended Posts

!(HandgunWeapon Miller=="")

iv got this and when ever a handgun is in the gun slot of the player the enemy shoot him.
How do i add a few more items into that bit of code ? 

 _itemsplayer = items player;

 [<Map>, <Compass>, <Watch>, <Radio>, <GPS>, <NVG>, <Binoculars>] same with his uniform / cloths aswell.

I found the bits of code above on the wiki but i still cant see how to stuff the bits together.

this will help with the immersion.
if the player stands up, or starts taking his items back out of the box they will shoot him. so this way he is forced to watch the screen and listen to the music.

another condition im thinking of is making the hostage player have to constantly crouch and stand otherwise he will get shot :) this will destroy the player lol but i cant decide on making him sit and watch or dance sort of thing.
 

Share this post


Link to post
Share on other sites
!(HandgunWeapon, <Map>, <Compass>, <Watch>, <Radio>, <GPS>, <NVG>, <Binoculars> Miller=="");

this dont work. but maybe you can see what im trying to do now.

Share this post


Link to post
Share on other sites
7 minutes ago, Quack Rejackt said:

How do i add a few more items into that bit of code ? 


That's for miller or player? or player is miller?

 

Share this post


Link to post
Share on other sites

Yes for Miller. Miller is AI if no player uses that slot or switches unit. This way you can play the mission in solo or as a cooprative mission. Meaning, the hostage just stands still untill conditions are met if its the AI, but the player has the freedom to move about and try to escape.  It also means when all of the rescue team are dead, you can switch to the hostage and try to escape. 

Share this post


Link to post
Share on other sites

Not sure you will succeed in MP writing if you have no skill about code.

Anyway, you can catch your miller's inventory with such command as getUnitLoadout

The returned data is an array of arrays with all items, weapons,...

More precisely, something like:

[
  [type of primary weapon,"","flashlight if any or laser","its optic",["magazine1",count],[],""],
[same for secondary weapon],
[same for handGun weapon],
[type of uniform",[["FirstAidKit",3],["CUP_30Rnd_556x45_Stanag",1,30]]], // example
[type of vest,[["FirstAidKit",1],["CUP_7Rnd_45ACP_1911",2,7],["SmokeShell",1,1],["SmokeShellRed",1,1],["CUP_30Rnd_556x45_Stanag",4,30],["30Rnd_556x45_Stanag_Tracer_Yellow",3,30], // example

["CUP_HandGrenade_RGO",2,1]]],
[same for backpack],
type of helmet,
"",
[],
["ItemMap","ItemGPS","ItemRadio","ItemCompass","ItemWatch",type of NVG]

]

So, yes, you can check for an existing (or missing) thing in inventory but I can't decide what you want.

 

For simpler check (when you know what you want), you can use smaller command, for this kind of condition:

"ItemCompass" in assignedItems Miller  // return true if miller has a compass.

or even:

{_x in assignedItems Miller} count ["ItemCompass","ItemWatch","ItemMap","ItemGPS"]  // return the number of assigned items. That means in the right operative slot (not in backpack). for items in backpack you need to use backpackitems miller

and so on.

 

 

Share this post


Link to post
Share on other sites

Thats why im asking for help on the forum. Theres only one way to learn and thats by trying to do it. 

This works. and its simple as could be.
!(HandgunWeapon Miller=="")

How do i combine the 2 bits ?
!(HandgunWeapon Miller=="")
{_x in assignedItems Miller} count ["ItemCompass","ItemWatch","ItemMap","ItemGPS"]

There must be some variable / name like HandgunWeapon but it includes all inventory items, like the map gps n all that right ? as HandgunWeapon includes all of the pistols in the game.

yeah i dont want it to trigger if the gun is placed in a cloths, vest, bag slot. 

Share this post


Link to post
Share on other sites

(currentWeapon Miller !="") && what you want

 

what you want can be: ({_x in assignedItems Miller} count ["ItemCompass","ItemWatch","ItemMap","ItemGPS"] > 0) // that means at least one of these items is workable.

or

({_x in assignedItems Miller} count ["ItemCompass","ItemWatch","ItemMap","ItemGPS"] == 0) // that means none of these items is workable (in good slot)

Share this post


Link to post
Share on other sites
!(HandgunWeapon Miller==""); ({_x in assignedItems Miller} count ["ItemCompass","ItemWatch","ItemMap","ItemGPS"] == 0);

this gives me an invalid number expression error message.
 

!(HandgunWeapon Miller=="") && ({_x in assignedItems Miller} count ["ItemCompass","ItemWatch","ItemMap","ItemGPS"] == 0);

same error

Share this post


Link to post
Share on other sites

Probably because your miller doesn't exist. You need to name a unit miller in its variable name (editor);

I wrote you (currentWeapon Miller !="") instead of !(HandgunWeapon Miller=="")

currentWeapon is for any weapon in hands of Miller. handGunWeapon works for any hand gun in hand gun slot (no need to have it in hand). You see the difference?

Share this post


Link to post
Share on other sites
!((HandgunWeapon Miller==""{ _x in assignedItems Miller} count ["ItemCompass","ItemWatch","ItemMap","ItemGPS"] == 0));

something like this must work. but this gets Condition: Missing) message

Share this post


Link to post
Share on other sites

I have a unit named Miller. this all started with me saying i have this code and its working !(HandgunWeapon Miller=="") 

mil.jpg

Share this post


Link to post
Share on other sites

copy / paste:

(currentWeapon Miller !="") && ({_x in assignedItems Miller} count ["ItemCompass","ItemWatch","ItemMap","ItemGPS"] == 0)

Share this post


Link to post
Share on other sites
7 minutes ago, pierremgi said:

copy / paste:

(currentWeapon Miller !="") && ({_x in assignedItems Miller} count ["ItemCompass","ItemWatch","ItemMap","ItemGPS"] == 0)

No this didnt work either.
when the condition is met, the civ gets assigned to independents and i get a new task assigned. plus they didnt shoot me, and also the computer ran really slow at the start with this bit of code. I didnt get any errors though.

Thank you for your help i do appreciate it :)

  • Confused 1

Share this post


Link to post
Share on other sites
(currentWeapon Miller !="") && ({_x in assignedItems Miller} count ["ItemCompass","ItemWatch","ItemMap","ItemGPS"] == 0);

this fixed the framerate but nothing happens when the items are put in the inventory. 

Share this post


Link to post
Share on other sites

framerate? nvm

 

To make it short, you should begin writing what you REALLY want:

- In plain language,

- with the situation at start

- and who,what,when. Here when is your condition. What are the consequences. Who seems to be Miller

 

Right now, you're trying anything without understanding how (trigger's) condition works.

We discover you're writing about civilian (probably Miller) assigned to independent...???? with a task....

Why not. I'd rather make miller independent at start and setCaptive true, then false,  but everything is possible if correctly scripted.

 

I'm sure you're trying to modify an existing script.

So, this way to proceed is a waste of time for both of us! As already wrote, make order in your ideas, tell us what you REALLY want, in plain language and no more considerations about "f...g" items we don't care. Stop telling a condition doesn't work if you don't know what condition you want. Thanks.

  • Sad 1

Share this post


Link to post
Share on other sites

lol i did and you couldnt be bothered to try and understand it. yes frame rate  because there was a missing ; the frames were jammed, i couldnt turn,  no sounds could be heard because it was all clogging up.

i showed what i had, i showed my working out and findings, and i asked how to put it all together. i even gave a reason for why i want it all.

Share this post


Link to post
Share on other sites

if you see this as wasting time. dont repliy. its on a forum. im not ringing you on your mobile or pm'ing you.

 

its clear what conditions i want. civ picks up hand gun, or map, or his cloths and so on and the condition is met. !(HandgunWeapon Miller=="")
that works. if thats not a clear condition i dont know what its ? 

you even said have you got a unit named miller ? go away and bother someone else. 

Share this post


Link to post
Share on other sites

The code dont work yet but we is close.

The hostage is a civ that is setCaptive, his variable name is Miller. When a trigger or 4 go off, Miller the captive civ joins a member of the independent group. this makes the hostage hostile to the enemy L: Only the hostage can make the enemy hostile towards him. Independents can make the enemy move the hostage to a new location with other trigger conditions.

A task is assigned to let the player/s know that they need to return the hostage to the terminal. weather the rescue team gets to the hostage or if the hostage trys to escape. It also switches that unit from one faction to the other  making him hostile to the enemy / opfor 

are you following along SIr ? :drinking2:

condition - onactivation some level of understanding right ? this isnt all stuff i want. its all set up and working.

i came here asking how to add a few more items to a simple efficient condition.  Your not working with what iv provided, your just assuming im a spastic because im shit at coding and writing, right ? and saying why not just make him an independent and set him captive. you didnt try to understand what i want.

Share this post


Link to post
Share on other sites
5 hours ago, pierremgi said:

framerate? nvm

 

To make it short, you should begin writing what you REALLY want:

- In plain language,

- with the situation at start

- and who,what,when. Here when is your condition. What are the consequences. Who seems to be Miller

 

Right now, you're trying anything without understanding how (trigger's) condition works.

We discover you're writing about civilian (probably Miller) assigned to independent...???? with a task....

Why not. I'd rather make miller independent at start and setCaptive true, then false,  but everything is possible if correctly scripted.

 

I'm sure you're trying to modify an existing script.

So, this way to proceed is a waste of time for both of us! As already wrote, make order in your ideas, tell us what you REALLY want, in plain language and no more considerations about "f...g" items we don't care. Stop telling a condition doesn't work if you don't know what condition you want. Thanks.

look if it worked the opfor units would of shot the civ unit but nothing happens when you place the items in your inventory or if you have a weapon in your hands.
wtf is this guys problem ? 

what do you mean im trying to modify an existing script ? in what way ? 
scripts.png
 

Share this post


Link to post
Share on other sites

The key to getting getting a good answer is asking a good question.

  • Like 2

Share this post


Link to post
Share on other sites

And English isn't Pierre's first language, though his English is much better than some English people i know. Lol

You could start out by explaining what you are trying to achieve, not what's gone wrong when trying to achieve it.

from here, it does look like you are trying to run before you can walk

  • Like 2

Share this post


Link to post
Share on other sites

I dint think so after his outbursty response, but id allready got offended by then. im sorry. 
I know my english is bad, ok. but im trying to lose my self in something i believe in. no one i know wants to play games or game modes like this. What is VR all about anyway ? this sounds like a great mission for that sort of thing ? 

your English, you know that i did explain those things, or at least explained them better afterwards. just because his bit of code didnt work, he lost the plot. 

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

×