Jump to content
Sign in to follow this  
steelblood

Build Application ? Or Script

Recommended Posts

Hi

As always i apologise incase this does already exist ( I do search honest ! ;) ) However i've had an idea...

Is it possible to make a script that allows the player to have a "Build" menu not like warfare mode. So basically when you "Scroll" through your options you can say for example place a H-Barrier ? A bit like a sandbox mode i suppose but not quite :P.

I don't really know how to explain it properly but hopefully you all get the jist. So my question is this possible and how would i do it :D ?

Thank's alot

Dan

Share this post


Link to post
Share on other sites

I guess that would require dialogs but i'm not really familiar with them so i can't help you... ;)

Share this post


Link to post
Share on other sites
Hi

As always i apologise incase this does already exist ( I do search honest ! ;) ) However i've had an idea...

Is it possible to make a script that allows the player to have a "Build" menu not like warfare mode. So basically when you "Scroll" through your options you can say for example place a H-Barrier ? A bit like a sandbox mode i suppose but not quite :P.

I don't really know how to explain it properly but hopefully you all get the jist. So my question is this possible and how would i do it :D ?

Thank's alot

Dan

Sure.

Place a player on the editor.

Put the following on his init line:

action_1 = this addAction ["Place H-Barrier", "barrier.sqf"];

Then just create a file on your mission folder after saving it called barrier.sqf

Inside put:

private ["_obj"];

_obj = "Land_HBarrier_large" createVehicle (position player);

That should work.

Edited by neokika

Share this post


Link to post
Share on other sites

What you might do would be to add the action to a vehicle or helicopter that you place in game. And you would have to add each item in the vehicle with the addaction command that you would want access to. You might also consider organizing it with multiple vehicles for different types of objects and what not.. and set yourself up a teleporter to the area the vehicles are in. I would try to keep it as simple as possible though. Otherwise it kind of defeats the purpose. Is this for an RPG concept?

Share this post


Link to post
Share on other sites

I was thinking more of a "Build up Base and defend" mission either against i know *sigh* ...zombies.... or against waves of enemies as you could have a countdown trigger not letting the enemies move towards you until say 10 mins has passed and you have been able to build your base :D

Share this post


Link to post
Share on other sites

I would definatly tie the action menu to a vehicle or object. If you tie it to a player it will be there all game and get in the way when they need to change weapons and what not. You can set up a looping script for the addaction commands that waits for the player to be within a certain range of the vehicle and then fires all the addaction commands and scripts associated with them. Then on the back end of it you put a check to see when the player is outside the range and it deletes the actions from the players menu. I use it all the time for base building stuff and Armor factories and what not. I would post a snippet but I do not have my stuff with me. Plus it would all be in SQS which people don´t seem to like. It would go something like this though if it helps:

#Start
~1
?!(alive Player):goto "RemoveMenu";
?(Player distance _NameofObject)<=7:goto "ActivateMenu";
goto "start";

#ActivateMenu
_MenuOption1 = _NameofObject addAction ["Place H-Barrier", "barrier.sqf"];

#Check
~1
?!(alive Player):goto "RemoveMenu";
?(Player distance _NameofObject)>7:goto "RemoveMenu";
goto "Check"

#RemoveMenu
_NameofObject removeaction _MenuOption1;
goto "start"

I am sure I made some mistakes in there but you get the idea. It is very basic but it has worked for me on multiple maps.

Now with this all it will do is give you the menu option "Place H-Barrier" and when selected it will start Barrier.sqf. In that script you would need to add the execution of another action menu script on the newly created item that will allow you to rotate it on atleast 1 axis and shift it´s position along the X and Y axis. Have each Barrier.sqf script execute the movement options script. It will save you allot of copy paste time.

I would research all of this though I am going off memory. Good luck hope I helped

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  

×