Jump to content
Sign in to follow this  
Shabadu

Ofp rts

Recommended Posts

Hello all.

 I am trying to come up with some scripts that will form the basis for an rts mission. The idea is that I am trying to make the building blocks with which a simple rts can be made and then if you want to turn it into a mod or make it more interesting that's up to you.

The premise is I use a trigger on or near a building which will operate as a factory. The trigger will then activate a script that uses AddAction for each vehicle tat is  made available in the script.

This will then go to a script which will wait a little bit while displaying the words

"Building (WHATEVER HERE)" and then uses CreateVehicle( I can't remember the names of the commands just now) to insert WHATEVER.

Because you can't enter a vehicle that has been made using CreateVehicle I had to add to the script a MoveInCommander, or MoveInDriver to make the vehicle available. Trouble is I don't want to be lumped into a tank every time I construct one, you might be fighting or something. I need someone to give me an idea as to how I might remove the player from the tank, or perhaps you have another solution...

Another thing that's bothering me is that I can't get rid of the action once it has been "AddAction"ed. If you use remove action you can only remove the action added in a specific order.

I could solve this if it were possible to set up variables. In bascom I would set a variable 'A' and simply add or subtract to it but here I don't know if this can be done.

Anyone who helps out in anyway will be given joint ( I can't think of the word so I'll use...) 'blame' for the scripts and will be the first to receive copies of them before they get bunged up on some site somewhere.

Share this post


Link to post
Share on other sites

I'm thinking that I would use 5tTrucks as resource collectors. They would be driven into an area which would be covered by a trigger which would have a numerical value attached to it to determine the max amount or RUs in it.

Perhaps these resource areas would be recognisable either by putting something like rocks to make it obvious or perhaps using survey teams or something.

A little help anyone?(Re:original post) smile.gif

Share this post


Link to post
Share on other sites

I think for the triggers in a resource area, you should simply use a countdown. For example it could take a resource truck 80secs or so to completely fill his load completely. After this time he should drive to his base and move next to the mine building. But the problem is how to tell by triggers that the truck has been filled with resources. Because the player will surely be able to build a lot of these trucks, am I right? Maybe with a group-trigger if something like that is possible?

For a resource area I would only make a marker on the map, maybe an ellipse with grids or diagonals. Resources are normally not lying on the ground, so why changing the visibility of the ground?

Share this post


Link to post
Share on other sites

The trouble is I don't want to go right into a full RTS. What I want is to simply have the trucks pull up in the area and the player gets out, goes to the back of the truck and gets a 'start mining' command. Then the RUs get credited to your supply. I can't be bothered with the whole going to collect RUs then going back and unloading etc... It's a very simplified RTS.

The idea is to male a set of versatile scripts which people can edit as they please. So it would probably become simple to create a proper RTS from what is put together. It's just a framework so to speak.

Share this post


Link to post
Share on other sites

The commands are set in the description.ext, right? So, maybe you should first make the mining-command available to the player. Like the reload or enter vehicle commands.

If the player uses the command this sets a trigger which leads to the mining script. Is that the way you mean?

Share this post


Link to post
Share on other sites

Yeah this is exactly it but the problem is that you end up with the command permanently. I need a bit of code or some parameters which mean you only use it next to the truck. Same problem with factories.

Share this post


Link to post
Share on other sites

Hmm... Unfortunately I don`t know how BIS made the commands for getting in a vehicle, when you stand next to it. Because that would be exactly what you need. If you could get this information the connection to a trigger should be no bigger problem after all. Sorry... confused.gif

Share this post


Link to post
Share on other sites

Yeah I guess. Trouble is such things aren't mentioned in the scripting reference( which is both useful and pants at the same time). I'm hoping someone with experience in scripting ofp might be able to help out a bit. Especially seeing as I've never done any coding before. Only a little so far in Electronics and we weren't programming software, we were programming micro-controllers to make LEDs flash and controlling motors. V. different

Share this post


Link to post
Share on other sites

Look into ofpeditingcenter.com. There are good tutorials, especially Johannson`s scripting tutorial is great. Maybe someone there can help you.

Share this post


Link to post
Share on other sites

Mmm, good point. Will check in with them lot.

Share this post


Link to post
Share on other sites

Cheers. I'll take this baby apart when I get home.

Share this post


Link to post
Share on other sites

Isn't anyone interested in helping out? All I nedd is a clue as to how this damn coding language likes to operate and I'm away. Some ideas wouldn't go amiss neither.

Share this post


Link to post
Share on other sites

nice idear i need some ofp rts game to keep me going till conqest comes out (if it does at all)heres an idear how about captureing towns for recorces so say u capture a town and u get recorces every now and again for having that town and the bigger the town the more u get.

Share this post


Link to post
Share on other sites

to get rid of a specific action that was given to a player, you would do something like this:

Instead of: player addaction ["Mine Here","Mining.sqs"]

Do this: ActMining = player addaction ["Mine Here","Mining.sqs"]

Then in the "Mining.sqs":

player removeaction ActMining

This line 'ActMining = player addaction ["Mine Here","Mining.sqs"]' will add the action to the player AND set the GLOBAL variable 'ActMining' to equal the action given the player. Being global, it can be used in the mining script to remove that exact action.

If you are making a single player game, when you create a mining vehicle, you can add the action to the vehicle instead of the person, and anytime the player walks near the vehicle, the action will appear on his action menu, just as the 'get in' action will, and will be automatically removed when the player walks away from the vehicle.

If you are making MP game out of this, giving the commands to the vehicle might not work properly, that is some problems I am having right now with some scripting.

As far as resources for a particular vehicle, I would name each vehicle, and in the init.sqs, I would initialize variables for each mining vehicle such as: MineTruck1Cargo, MineTruck2Cargo, etc.. then when a particular trucks action for mining was invoked, and the truck was in a resource area, you could run a script that starts to add to the value of 'MineTruck#Cargo' at perhaps a couple units a second, and loop until it's value is 100, then the vehicle's cargo would be at 100% in 50 seconds.

Hope this helps..

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (Maj Chip Hazard @ June 08 2002,19:53)</td></tr><tr><td id="QUOTE">to get rid of a specific action that was given to a player, you would do something like this:

Instead of:     player addaction ["Mine Here","Mining.sqs"]

Do this:          ActMining = player addaction ["Mine Here","Mining.sqs"]

Then in the "Mining.sqs":

player removeaction ActMining

This line 'ActMining = player addaction ["Mine Here","Mining.sqs"]'  will add the action to the player AND set the GLOBAL variable 'ActMining' to equal the action given the player.  Being global, it can be used in the mining script to remove that exact action.

If you are making a single player game, when you create a mining vehicle, you can add the action to the vehicle instead of the person, and anytime the player walks near the vehicle, the action will appear on his action menu, just as the 'get in' action will, and will be automatically removed when the player walks away from the vehicle.

If you are making MP game out of this, giving the commands to the vehicle might not work properly, that is some problems I am having right now with some scripting.

As far as resources for a particular vehicle, I would name each vehicle, and in the init.sqs, I would initialize variables for each mining vehicle such as:  MineTruck1Cargo, MineTruck2Cargo, etc..     then when a particular trucks action for mining was invoked, and the truck was in a resource area, you could run a script that starts to add to the value of 'MineTruck#Cargo' at perhaps a couple units a second, and loop until it's value is 100, then the vehicle's cargo would be at 100% in 50 seconds.

Hope this helps..<span id='postcolor'>

Good Gravy! I love you. You just solved what was probably the biggest problem I have had with these damn scripts. What do you reckon to handling the resource values. I think I know how to make it display the amount you have but I'm not quite sure how to use the global variables in order to maintain a value. If I figure out how to do this then adding to it using actmining will be childs play. biggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gifbiggrin.gif

Share this post


Link to post
Share on other sites

If anyone is interested in seeing what I have so far. It is showing promise but I need a little help with the coding. Let me know and I'll send you the zip.

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote </td></tr><tr><td id="QUOTE">If anyone is interested in seeing what I have so far. It is showing promise but I need a little help with the coding. Let me know and I'll send you the zip.<span id='postcolor'>ill have a go dmurphyman@hotmail.com

Share this post


Link to post
Share on other sites

Well some of that depends upon what you're attaching the actions to. In that case you'd probably want to attach it to the miner using local variables, and then let that script monitor the vehicle until it is destroyed or something, and then the action would be removed.

Something like:

_mineaction=_vcl Addaction ["Start Mining","Mining.sqs"]

@!Alive _vcl

_vcl RemoveAction _mineaction

Exit

Have you tried RTS2 yet? It has similar concepts in it, except resource gathering is a bit different. You have workers (civilians) who will earn you money at your base, and if a base building is destroyed, then they will run over and repair it, but while they're working, they don't earn money.

You can also earn money by taking a CH47D, Mi17, or a Construction Jeep and find destroyed vehicles and recycle them for money.

In my original RTS missions, you earned money for capturing and holding towns and for recycling and for having oil refineries. I may create some other RTS2 missions where you can earn money for holding towns or something like that, but I'm not going to do it until the base code is to a final point, so I don't have to constantly update several missions.

Share this post


Link to post
Share on other sites

Hi there! If you want to play RTS in Operation Flashpoint than try out Dynamic CTF. This Project has become really advanced and is working in Multiplayer 100% without any loss of great features! You can build Vehicles, conquer towns and have a whole war on your favourite OFP-Island. We have nearly finnished Version 1.1 of Dynamic CTF and you can download a beta-test demo version on http://powermage.dyndns.org/ofp/. There is also a manual. Read it to get a glimpse of all it's features! This version is including new special vehicles like transport helicopters, mobile artilery and flak. You can also build your own assault base anywhere on the map with the mobile base! Check it out! It's hot! wink.gif

Also visit official discussion forum for DynamicCTF at www.planetofwar.com!

Share this post


Link to post
Share on other sites

</span><table border="0" align="center" width="95%" cellpadding="3" cellspacing="1"><tr><td>Quote (PowerMage @ June 19 2002,00:21)</td></tr><tr><td id="QUOTE">Hi there! If you want to play RTS in Operation Flashpoint than try out Dynamic CTF. This Project has become really advanced and is working in Multiplayer 100% without any loss of great features! You can build Vehicles, conquer towns and have a whole war on your favourite OFP-Island. We have nearly finnished Version 1.1 of Dynamic CTF and you can download a beta-test demo version on http://powermage.dyndns.org/ofp/. There is also a manual. Read it to get a glimpse of all it's features! This version is including new special vehicles like transport helicopters, mobile artilery and flak. You can also build your own assault base anywhere on the map with the mobile base! Check it out! It's hot! wink.gif

Also visit official discussion forum for DynamicCTF at www.planetofwar.com!<span id='postcolor'>

Yeah the main problem is I can't play online cause I don't have internet at home. Also downloads are limited to floppy size. I have file splitter but the number of disks I have is limited since these computers seem to corrupt my disks.

Anyway you missed the point, I want to make the basics of rts available to anyone for mainly sp use. I don't really find that many other peoples missions very good(personal taste I don't mean they're bad or anything).

I'm still trying to get an idea of how to create a dynamic variable for RU's. Ideas still welcome but I'm slowing work due to exams.

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  

×