Jump to content
egbert

Place an item with no possible interaction.

Recommended Posts

Hi there !

 

I'm currently working on a gun store with the new Eden Editor. So I place a bunch of guns, on shelves, but I don't want them to be usable. I disabled simulation, but unfortunately, it is still possible to take them (the action menu still allow that), and when the player grab a gun, it fall on the floor and that's it.

What I'm seeking at, is a way, maybe a line to add in the init field, to remove all possible interaction with the guns. I just want them to be decorative, no more.

 

Oh and while I'm asking, would it be possible to also remove the "bomb detected" message when approaching an explosive charge ? Since I also placed some of this babies on the shelves too. Making them unusable too, for safety !

 

I use no mods for now, but I will once all of this will be finished (ACE3 - TFAR mostly).

 

Thank you in advance if anyone has the answer !

Share this post


Link to post
Share on other sites

 

Sorry, tryed, but don't know how to make it, at least after 1-st action it beginning fine (try to move it up and try to pick up again).

(Leave it pickable (more realistic)).

Share this post


Link to post
Share on other sites

I think the pre-eden way to do this (by script) would be:

_weapon = "arifle_katiba_f"; //Class name of weapon
_pos = [0,0,0]; //position of the weapon

_holder = "Library_WeaponHolder" createVehicle _pos;
_holder addWeaponCargoGlobal [_weapon,1];

It might be possible to get the exact coordinates for "_pos" from EDEN.

  • Like 1

Share this post


Link to post
Share on other sites

 

Working.

But can't spawn in air.

_ll = "Library_WeaponHolder" createVehicle (player modelToWorld [0,1,1]);
_ll addWeaponCargoGlobal ["arifle_katiba_f",1];
_ll enablesimulation false;

Share this post


Link to post
Share on other sites

Try GroundWeaponHolder instead.

Thats the point - it shouldn't be pickable, and anyway do not helping.

..

Writed by my self:

`"createvehicle" using algorithm to find empty place `(on ground `(not: where it can stand)).

...

so:

_ll = "Library_WeaponHolder" createVehicle getpos player;
_ll addWeaponCargoGlobal ["arifle_katiba_f",1];
_ll enablesimulation false;
_ll setPos (player modelToWorld [0,1,1]);

Share this post


Link to post
Share on other sites

Thanks guys, I'm gonna see if I can fix my problem with your answers !

Share this post


Link to post
Share on other sites

Well sorry to come again, but it appears it doesn't work. t.a.6, I think your answer is really close to what I'm trying to do.

I tried to place 1 katiba on the floor, with your code in the init field. I removed all underscores because I want it local for now. I don't know if it is the proper way to do that.

So it spawns the katiba on the floor, like normal, and a second one floating 1 meter in front of me, 1 meter above the floor (so far so good). I can't take the floating katiba, but I can still access to its inventory, which I wish I couldn't, but that would be OK like that. Problem is : there is still the first katiba on the floor, the one i placed with editor, and I can take it and use it.

 

Since I'm not very familiar with coding and scripting, could you please tell me if :

 

-First, removing the underscore may cause problems with what's next,

-It is possible to make the katiba I placed with editor invisible, or if I must place it deep down in the sea ?

 

And I didn't figured out what the first line of your code means.

 

Anyway, thanks a lot for your help mate !

Share this post


Link to post
Share on other sites

Unfortunately I can't figure if you have to use this command in the init field or in an external script.

It sucks to be a noob...

Share this post


Link to post
Share on other sites

External script. Place the rifle in the editor, log the position and create the object in a script. Like the the init.sqf.

If (isServer) then { createObject "whatsTheSyntax"}

Share this post


Link to post
Share on other sites

For what you want to achieve, use the inGameUISetEventHandler command. You'll have to experiment with it but it's possible to have it do nothing if one of your 'special' weapons is interacted with. You can't remove the scroll option but when it is pressed, it will do nothing.

Share this post


Link to post
Share on other sites

Solution for editor. Place and invisilbe (in fact even visible will work, see below) heli pad (Empty -> Objects -> H (Invisible)).

In its init write:

lwh = "Library_WeaponHolder" createVehicle position this;
lwh addWeaponCargoGlobal ["arifle_katiba_f", 1];
lwh enableSimulation false;
// optionally change position relative to helipad
lwh setPos (this modelToWorld [0, 0, 0.5]);
// this is why you can place visible helipad
deleteVehicle this;

You will still have "Inventory" action, standard inventory dialog will open, but you will not be able neither to get this weapon nor to place something in the same weapon holder.

Share this post


Link to post
Share on other sites

 

The code is to create and move the object (it doesn't contacted to placed objects) (You just need to get position, where to move to, (as pedeathtrian said you can create invisible object to get it's position or write in the object's init:

deletehicle this;

(to delete the object))

inventory still is, yep, but all other fine, " createobject " i guies is what you need, but i'm hearing first time about the command.

and yes:

lwh setdamage 1; //will prevent inventory

(just after writed, readed pedeathtrian 's post to over ) ).

(just in case)

ll = "Library_WeaponHolder" createVehicle getpos this;
ll addWeaponCargoGlobal ["arifle_katiba_f",1];
ll enablesimulation false;
ll setPos (this modelToWorld [0,0,0]);
deletehicle this;
ll setdamage 1;

Share this post


Link to post
Share on other sites

createobject  is new and may only be available in the DEV version.

 

It uses the p3d file.

 

tr = createObject ["a3\plants_f\tree\t_ficusb1s_f.p3d",position this];tr setpos (tr modelToWorld [0,0,6])

 

It will work for weapons but as yet I haven't seen one that doesn't show the muzzle flash, they also need to be raised in height quite a bit or they are placed underground.

Share this post


Link to post
Share on other sites

createobject  is new and may only be available in the DEV version.

 

It uses the p3d file.

 

tr = createObject ["a3\plants_f\tree\t_ficusb1s_f.p3d",position this];tr setpos (tr modelToWorld [0,0,6])

 

It will work of weapons but as yet I haven't seen one that doesn't show the muzzle flash, they also need to be raised in height quite a bit or they are placed underground.

Copy, when the " Eden " can come out?

Share this post


Link to post
Share on other sites

I think  I read where it should be this month, I also think they will include an option in EDEN to place decorative objects directly rather than having to script them.

Share this post


Link to post
Share on other sites

I think  I read where it should be this month, I also think they will include an option in EDEN to place decorative objects directly rather than having to script them.

Thanks, yeahh, edeen, coming

(actually absolutely useless for us (we are starting on almost empty maps and populating it on the play), but 3d editor it's coool ) ).

Share this post


Link to post
Share on other sites

A big thanks to all of you who helped me figuring out how to place "decorative" objects !

 

So, apparently, the "createObject" function will be implemented in Eden as a check box in the attributes of an item, like the "enable simulation" which is already functional for what I could see in devbranch and RC 1.56.

 

Thanks to you, I've been able to place some objects with no interaction possible, but the only problem I didn't manage to fix was the rotation of these objects. I wanted them verticals, like if you hang a weapon on the wall (I agree it doesn't happen often to most people, but ey, it's Arma, not real life :) ).

 

The other little problem was I already designed a whole gun store with Eden, so it was a wee bit long to copy all positions of all my objects (nearly 500) into the init fields.

For now, I think I just won't allow access to the gun store, in order to prevent any interactions between the guns and the players, and when the new "decorative" function will come out, I'll fix that with this easier way !

 

But I learned a lot with your help, and I'm very grateful for that !

Many thanks to all of you, keep up the good work, Arma's community is the best in the world !

 

Cheers !

Share this post


Link to post
Share on other sites

use setvectorup

lwh = "Library_WeaponHolder" createVehicle position this;
lwh addWeaponCargoGlobal ["arifle_katiba_f", 1];
lwh enableSimulation false;
lwh setPos (this modelToWorld [0, 0, 0.5]);
lwh setdamage 1;
lwh setvectorup [0,-1,0.01];
deleteVehicle this;

Even if createobject isn't in EDEN as an option I would think someone will do it as a plugin.

Although so far the results of any performance increase have been somewhat less than great and in some cases worse than createvehicle.

Share this post


Link to post
Share on other sites

Thanks all of you for your answer !

 

So I resolved my problem with a simple, quick, and surely not "FPS friendly" way : I added a setdamage 1 in all the weapons, in addition with enableSimulation false. And it's working.

 

I tried the brand new "createSimpleObject" command, which I'm sure will be more convenient in the future, but for now it didn't fit my needs. First of all because not all the weapons are present in this list, and because the weapons avalaible spawn with some kind of flash going out the canon, exactly like they are shooting. I didn't have the time to dig in so I decided to take the easy way to achieve my goal.

 

Anyway, I now have my guns untakable (is this a real word?), unmovable, and that's fine for me !

 

Thanks again guys !

 

PS : I now have the exact same issue with intel files, which show a "Take Intel" action, and I don't have a clue to make it disapear, even with the damage set to 1...

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

×