Home   Help Search Login Register  

Author Topic: Batch o' Scripts from Doolittle CTI (ACCEPTED)  (Read 5483 times)

0 Members and 1 Guest are viewing this topic.

Offline Doolittle

  • Contributing Member
  • **
  • _this select 0
Batch o' Scripts from Doolittle CTI (ACCEPTED)
« on: 22 Nov 2007, 21:20:33 »
Here's several missions that show off one or two things. 10 maps in the zip. Here's the readme.txt:

dooammobox - Ammo box starts with weapons and ammo.

dooartyhint - Get in arty and you see a display of direction and angle.

doobuysys - Building you can buy vehicles from. buyarray.sqf makes an array so that all the time it takes to read config files is just done once for all the names and icons.

Code: [Select]
["Vulcan", "Vulcan" call _vehdisplayfunc, "Vulcan" call _vehpicfunc, 2000, "buytankheavy.sqf"],
This is vehicle type, vehicle name, vehicle picture, cost, optional script to call when you build something. If there is no optional build script then the one listed for the building is used (buytanklight.sqf).

Code: [Select]
buyarray = [["Land_garaz", [_westarray, _eastarray, _guerarray], "buytanklight.sqf"]];
Note when I make a vehicle I reveal it to the client so that they can get in right away. I also call setVectorUp on it so that it will be "activated" and drop to floor.

doocleanup - A trigger which will clean up dead vehicles and bodies. The program has to see something alive and then if it's missing in the next scan (every 3 sec) then it assumes it's dead and sets to delete. One issue is when a tank is hit and crew jumps out and then the vehicle explodes and kills everyone. So they don't make my scan list. To fix this I just scan for dead bodies near any wrecks when it's time to delete them.

dooenvironment - Sync time and weather with everyone joining. Sends server time to each person connecting. A day is two hours in game. For the time I advance it forward at certain speeds. During sunrise and sunset you need to do this very slowly or it is really noticeable that time is being skipped forward.

dooflagcap - Move in a cap zone and cap flag. Server side script sets flag texture. Client sets markers and makes announcement that someone capped.

doooccupied - Marker shows on map when your team is in a zone. Also include a trigger to kill anyone going into it.

dooradio - Simple way to allow clients to run radio without having it run on everyone's machine. Radio use is sent globally to everyone so this is a trick to limit it to local use. Example given is a script which will repair a vehicle if it has a flat tire or is overturned.

dooteamswitch - Click on a dot on the map and switch spots and weapons with them. Also has example of team markers where there's a dot for teammates and also any AI you command.

doovehrespawn - Simple vehicle respawn. If you leave a vehicle it will respawn back where it started in 10 sec.

You need ArmA 1.08 and no addons required. As far as I know these don't need beta testing. They're in one single mission already (my CTI map) and they all work great in MP Join-in-progress.

Doolittle
« Last Edit: 31 Dec 2007, 15:23:25 by Mandoble »

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Batch o' Scripts from Doolittle CTI
« Reply #1 on: 22 Nov 2007, 21:40:55 »
Posting here is much worse than just needing betatesting, you are just opening the door of improvement requirements which some other victims of this forum have already suffered in the past  :P

Didnt Hoz advice you about this hazard?  ;)

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Batch o' Scripts from Doolittle CTI
« Reply #2 on: 23 Nov 2007, 12:04:36 »
Starting the suggestions process, I think it would be much better if you made your own initiation script for each of your packs, rather than requiring a lot of code copy-and-pasting into init.sqf. Thus, the user would just need to:
Code: [Select]
[param,...] execVM "doo_buysys_init.sqf";

rather than manually build a giant init.sqf by copy-and-pasting big chucks of text. Also makes updating your scripts easier, since the user never needs to mess with the init.sqf again, unless parameters have been added.
Note when I make a vehicle I reveal it to the client so that they can get in right away. I also call setVectorUp on it so that it will be "activated" and drop to floor.

Aha, I didn't realise that revealing a new vehicle would allow you to see the get in actions right away! I'd better use that in my SPON Money shop (don't worry, it isn't anything like your shop). I'm not sure exactly what you mean by "activated" when you set the up vector though. Activated in what way?
« Last Edit: 23 Nov 2007, 12:12:10 by Spooner »
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Doolittle

  • Contributing Member
  • **
  • _this select 0
Re: Batch o' Scripts from Doolittle CTI
« Reply #3 on: 23 Nov 2007, 18:59:36 »
Activated meaning it drops to line up with ground below it & doesn't just hover in air.

Yes, the scripts aren't as friendly as they could be for implementing. They were all ripped from a single map that combined them all to be a CTI game. They were all written to try and be as fast, efficient, and least CPU intensive with the idea that the map could evolve into having lots of stuff happening at once. It's kinda interesting to see all the "systems" that are needed in a map project: dead vehicle cleanup, simple veh respawn, occupied zone scanning, team markers, flag capture (most critical), building buildings that all clients can see and use.

Edit: Note I use a script to scan for nearby buildings and then add a use action to the player. This is because adding the use action to a building like the airport hangar means you have to walk to the center of it before you even see the action pop up.

Also note whenever an object is bought/made it can have a script executed for it that does something "special". Like in my CTI map if you buy a parachute, it will actually spawn a guy in the air. Buy a tower and it spawns a machine gun on the top too.
« Last Edit: 23 Nov 2007, 19:05:45 by Doolittle »

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Batch o' Scripts from Doolittle CTI
« Reply #4 on: 23 Nov 2007, 20:31:08 »
Good to know about the vehicle activation thing! I've added both of those new vehicle "preparation" techniques to my shop script now, so that is a boon for me; Thanks!

I have already considered allowing designers to add a function to be called when something is bought/sold to my shop, but I didn't think it was really needed in my situation. Nice to see that sort of thing put to good use by you to fill up a vehicle with crew. I personally dislike the area-based action system, but that is probably because I've played a lot of RPGs and MMORPGs and dislike interacting with thin air ;P You shouldn't take that as saying there is anything wrong with your script since no-one I've spoken too has said they don't like it, just that it isn't a method that I feel comfortable with (as a player).
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Doolittle

  • Contributing Member
  • **
  • _this select 0
Re: Batch o' Scripts from Doolittle CTI
« Reply #5 on: 24 Nov 2007, 08:44:59 »
That's funny. I never thought of it that way. Thanks a lot! Now I'll always wonder who I'm talking to the next time I buy something.

So what MMORPG do you play? I've been afraid to get into that... maybe too addicting.

Offline Spooner

  • Members
  • *
  • Mostly useless
    • Community Base Addons
Re: Batch o' Scripts from Doolittle CTI
« Reply #6 on: 24 Nov 2007, 12:32:06 »
Sorry for spoiling the future of buying for you ;P I always thought that people used the "talking into the air" method because they didn't want to use a real person, either because of lag issues or because smacktards would just shoot them. The former issue could probably be reduced by turning off the shopkeeper's AI, the latter by using one of the indestructible people (The female reporter, or one of the male reporters, unlocked with, for example the SIX editor upgrade, which is only required to add these characters, not to play a mission with them in). People could argue that this is unrealistic, but it is only unrealistic for smacktards that want to shoot unarmed civilians (since your shopping area should be a non-combat zone anyway). You could also connect the action to a static object like a computer or radio and it could give a good focal point and be perfectly reasonable. Still, as I said, most people seem quite happy with action-zones rather than action-objects, so...

I don't play any MMORPGs any more, but I played City of Heroes and Villains a lot and played WoW, Saga of Ryzom and Lord of the Rings a fair bit. They can be addicting, but not as much as programming is for me :whistle: ArmA scripting takes up most of my free time now, and it doesn't have a monthly subscription, though I do seem to be paying more than I should be toward my ArmA squad server, so it probably isn't much cheaper in real terms ;(
[Arma 2] CBA: Community Base Addons
[Arma 1] SPON Core (including links to my other scripts)

Offline Doolittle

  • Contributing Member
  • **
  • _this select 0
Re: Batch o' Scripts from Doolittle CTI
« Reply #7 on: 28 Dec 2007, 21:37:40 »
Erm, so can these be submitted?

Offline D.murphy man

  • Members
  • *
  • I'm a llama!
Re: Batch o' Scripts from Doolittle CTI (READY)
« Reply #8 on: 31 Dec 2007, 14:29:36 »
Hey thanks for these Doolittle, especially dooenvironment, I've been looking for a MP compatible time script for my MP Zombie RPG (check mission beta testing forum) if you don't mind ill add it to the next update of my mission, with credit of course.

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Batch o' Scripts from Doolittle CTI
« Reply #9 on: 31 Dec 2007, 15:08:47 »
Erm, so can these be submitted?

Yes  :)

Offline D.murphy man

  • Members
  • *
  • I'm a llama!
Re: Batch o' Scripts from Doolittle CTI (ACCEPTED)
« Reply #10 on: 15 Jul 2008, 19:56:52 »
Hey Doolittle, i have used dooenviroment for my quarantine mission: http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?s=26a3110d8da35c3036e24a332987cfa9;act=ST;f=67;t=70469;st=405

However some one has reported that the weather changes dont work on dedicated servers, and also JIP players always join in the day (whiles other could be playing at night).

I have directly pasted the sqf's and the lines out of the init into my own init.sqf directly into my mission, as well as the trigger from the example mission you provided with it. So i don't believe i have left any thing out.

Also would it be possible to add random fog levels?

Cheers,
     Murphy.