Jump to content
Sign in to follow this  
cadet

Open-World Scripting and... Zombies!

Recommended Posts

Hi folks!

So, I'll give you a little backstory to my project so you can better understand my purpose and usage of scripts etc.

First of all, I have no ability to scratch create code! :( I am however able to modify scripts as well as calling them in-game via the usual (init, trigger on act, init.sqf, etc...) so I am not afraid to muck around a bit. That being said I know when I need to have my hand held when I need explicit help, I'm old enough to have developed a decent sense of modesty.

So, I realize I'm entering the scene a little late, or at least out-of-date with things but, ArmA seemed the natural progression after coming from OFP 10+ years ago! The bonus is many things have already been discussed which makes it easier for me to learn again quickly, yes! The downside is discussion and response frequency is much lower. I've been watching a lot of DayZ gameplay on YouTube and decided I'd like to make a zombie apocalypse style gameplay for Arma(1). So I've gone and downloaded several Gb's of addons and began creating an open-world zombie infested Sahrani. I will eventually migrate to ArmAII or III, but for now I just want to beef up my editor and script knowledge base. Unfortunately, OFPEC's ArmA section is all but abandoned, ArmedAssault.info's new member registration is broken even though discussions are still current for ArmA, and most of the stuff posted on RockPaperShotgun is pretty advanced/elite.

Moving on! The first thing I did was create my character (Rick Grimes) of course, lol! I'm still looking for an appropriate skin to suit the character. Also, I'm striving for an open-world experience without cutscenes or missions per se. In the meantime I've setup the following; (*note, zombies are on side INDEPENDANT)

  • Drinking from wells replenishes health 7% every second (must stay inside trigger). Initiated by an addAction which uses a playMove and custom sound of sipping water.
  • Drinking from stagnant sources (water towers, fountains, etc) replenishes health by 1% every second. (same as above ^)
  • Implemented Sahrani Electrical Grid to disable all streetlamps at night. (I had figured it out using gamelogic's and getpos etc myself, but this script is a beaut!)
  • Created proximity triggered supply drops made by C130 using a 2km radius waypoint for randomness.
  • Created proximity triggers at all radio towers that display a message whether they are self-powered or not. (Eventual furthering of this includes sending/receiving pre-recorded "messages" or possibly tying it to survivor rescuing)

Ok, so that's it for now but before I continue adding more to the world I want to expand and perfect the existing "events".

My first problem is with the well drinking. I have a 2m ellipse trigger around the well with an addAction calling my drinking script. However, when I move away from the well I need the action to become hidden. I've tried using the "distance" function in varying combinations without success (I'm still struggling with the basic understanding of parameter vs Boolean vs syntax etc) and using the removeAction only removes the first instance of addAction. All subsequent addActions remain (going in and out of trigger repeatedly) unless I add a repeating removeAction increasing the variable by 1 for each. That works, but seems silly and possibly resource wasting? I've checked out Kylania's stuff (can't post links yet arggh!) but unsure how to implement with my trigger.

I'm wondering if it's possible to attach a distance function or something else to the well object ID itself?

This necessity carries over to my next questions. I have a "safe house" of sorts (a farm located away from cities and off the main roads) where I would like to implement a few features. The first I already have working to a degree. There is a dog house next to the barn, I've created a trigger about 250m radius that "Rufus" can detect zombies, and initiate barking sound if yes. Once I've killed all zombies inside the trigger, how do I stop the barking sound started by the trigger? I don't want to removeVehicle the trigger as I need it to be persistent for future zombie hordes.

The next part is there is a bed inside the house that I would like to use. For instance, upon approaching the bed an action appears "Sleep" which upon activation will put the character to sleep (screen blackout?) and 4 hours of game time will pass and the characters health will be fully restored (I can use a modified water health restore script here). Again, I need the action to disappear when I move away from the bed.

Something else I'm wanting to implement is random zombie spawn events. I downloaded the Coop Essential Pack as it contained a script to random spawn groups which would be deleted after you left the area, and it worked but I do not know how to specify specific units of a side. It would only spawn the generic Independent side soldier. There are like 30+ zombie units and it would be nice if I could call random zombie units! Make sense?! lol

One final thing is, eventually I'd like to have "safe zones" where I can transport survivors to. For instance I've created a rescue where survivors are atop a building and need rescue. Unfortunately, civilians are apparently completely retarded in ArmA and don't follow any waypoints or commands other than aiDisable "MOVE". I have even tried slaving them to a Blufor leader then set condition of leader presence to false but they still either walk off the building roof and die, or move to the stairs go down and then loiter in or around the building. They will not follow the waypoint command to GET IN synched with my LOAD waypoint. I've also tried using HOLD waypoints and using switch triggers but they don't adhere to waypoints in any way shape or form, wtf?

So, in closing I do realize that this is pretty ambitious especially for someone relatively new but so far I've managed on my own but I'm starting to hit doors that need dedicated scripts to open. That being said, I'm asking for genuine help and not criticism on my attempt or for using ArmA. My focus is on learning progressively into the next installments (ArmAII & III). I am open of course to general criticism on my appearance, accent, perspective, speelling, grammar, etc lol! Also, any additional ideas for immersion etc are welcome! This is all in the spirit of learning to create immersive open-world "campaigns" that could eventually lead to trigger activated dedicated missions.

Anyway, what a first post. I just wanted to make sure everyone knew I was serious in my endeavours and not wasting anyone's time. I can provide my "mission" if anyone's interested in trying it out and still plays ArmA, lol! But ya, first impressions and all that so I'll stop rambling now! (At what point will I be able to update my profile, add links etc? It is not stated in the user agreement, only that "regular members" don't have these limitations but there is no mention of what it takes to become a "regular member". I'm assuming post count/approval? Since I'm a spambot, these things are a necessity to my survival otherwise I face deletion by the source!)

Cheers and if you've made it this far, you win...my thanks, lol!

Harland (Cadet)

Share this post


Link to post
Share on other sites

Update! So whilst waiting for a moderator to pop my posting cherry I've managed to cobble together a crude, but functioning, sleeping script!

So the way it works is a trigger around the bed creates an addAction ("Go to sleep") which then calls a script;

sleep.sqf

disableUserInput true;
player switchCamera "EXTERNAL";
player playMove "AinvPknlMstpSnonWnonDnon_4";
sleep 1;
cutText ["Exhausted, you quickly fall asleep.","BLACK OUT",3];
sleep 1;
Player say ["sleep",5];
sleep 14;
skipTime 6;
sleep 2;
cutText ["","BLACK IN"];
player playMove "ActsPercMstpSlowWrflDnon_Lolling";
sleep 14;
player switchCamera "INTERNAL";
disableUserInput false;
while {alive player} do {_t = time; waitUntil {time - _t > 1};
if (damage player > 0) then {_newDamage = (damage player) - 1.00;
player setdamage _newDamage;}

};

Pretty simple stuff but self explanatory, and I managed to create this all by myself! Woohoo! The only thing is the cutText BLACK IN doesn't do gradual fading when an existing cutText BLACK OUT is being used, which is a documented issue. But whatever, success!

Don't worry, on my to-do list is learning proper coding structure, lol!

Also, through this process and starting with the well water drinking, I've had to learn the basics of the description.ext file as well, double bonus, YES!

I've also gone back to using my global gamelogic to disable all the streetlamps since it loads with the mission and affects the entire map inclusively. I'd love to have something in place where if I park a fuel truck inside a set area (next to the transformer station for instance) then it would allow me to power certain things or areas...hint hint ;)

Ok, enough for now. Back to the apocalyptic wasteland that is Sahrani!

Share this post


Link to post
Share on other sites

Ok, so I see I'm getting a few hits anyways, just no input/feedback etc... That's fine, I can work with that!

I do have a question about something. I just installed the A.C.E mod, really nice it is. Everything works wonderfully save for my supply drop. Everything about the supply drop still works, BUT as it descends to Earth it is emitting puffs of smoke and flame! Any ideas what's going on here would be helpful. I can provide the script etc and details on how I'm executing it. It is sort of handy at night as now I can easily see the supply crate as it floats down, but alas it does sap a certain realism from the experience, lol! The flames and smoke disappear with the parachute upon landing.

A couple other things I've managed to work out is placing map objects (cfgVehicles) anywhere I want from within the mission editor, cool! Haven't done anything exciting with that one yet though...

The other thing is destroying map objects and even setting that effect to a trigger and including a custom sound file. One example so far is demolishing a bridge when inside a trigger without having to set a single charge (the idea is it's a preset demolition of sorts)! It's fun to watch enemy tanks/units plummet into the water haplessly. The only downside is because there isn't an actual explosion, no damage is carried over to the affected units, but whatevers, it's sweet. I'll tweak it when I actually need it.

So up to this point I'm pretty much feeling like a pig rolling in his own shite, and what fun it is! Soooooeeeeey!

Share this post


Link to post
Share on other sites

Ok, so my latest romps around the ArmA world(s) have yielded some pretty good fruit.

So far I've learned how to generate basic item spawning i.e placing individual weapons with ammo.

I've swapped out the supply para-drop script with one that's more robust but with less script.

Added G85 and LowFly's editor updates.

Added a script to trigger exploding objects.

Learned how to spawn a vehicle in any specified or random area.

I've also learned that by simply grouping an object to an array of markers it will automatically create random positioning amongst the markers with no scripting at all. This will probably come in handy.

But, what I'm still struggling with is this; I'd like to have random weapons (with or without ammo) placed at random locations. The random locations will of course be markers so that the spawn locations will be realistic (yes, think DayZ here) such as inside buildings etc. I'd just like the items to spawn randomly where not every location will get spawned loot and the loot won't be the same in each spot. I'd like to tie this into a trigger zone that will activate upon entering and deactivate upon exiting, that way items will only spawn when I'm in the area, like a town for instance.

So, without creating dozens of objects or logics and grouping those with dozens of markers, I was hoping there was a script that would at least do the first part. Create random weapon/item spawning that I would then enter in my marker names/locations and the script could do the rest.

I'll look into this RPG Quarantine and see what I can dissect from it. I have to admit, all the (limited) videos I found on YouTube were not impressive by any means nor could I find anything showcasing it's features etc...but, perhaps I didn't look hard enough. You know YouTube, one minute you're looking at gameplay and the next you're watching some national geographic African safari animal porn...Ya, you know what I mean.

So, whilst I wait for scripting manna to fall from the ArmA heavens I will just have to continue my journey of self-discovery and zombie slaying.

I've been loving the A.C.E mod by the way, adds so much more depth to the game. Unfortunately, the weapon waggle when standing still is absolutely retarded. Either the weapons or the player has developed a nasty case of battlefield Parkinson's. Unless prone, the iron sights or CQB are intensely jittery. This is with nothing but a rifle, one mag, and no pack or added weight or exertion. Anyone know how to modify this so I can tone it down. Not an easy thing to find online for some reason...But A.C.E mod changed it from default to spastic, so it's obviously doable. JusT NEeD tO FiGUre It oUt. <- That's what aiming is like if you imagine a . as the sight dot....Luckily it doesn't stop me from picking off crows at 150m with an M9SD for a tasty meal over the campfire.

Peace out.

Share this post


Link to post
Share on other sites

I'm working on something similar with Arma 3 and the Wasteland mod. I would love to borrow your dog idea. Could you post up the script for that? I'll show my buddy who is better than I am at scripting. He may have some ideas. Good luck!

Share this post


Link to post
Share on other sites

My 'dog' is just a trigger zone setup to detect zombies (Resistance side) and when it does it starts playing the built-in barking sound. There's no actual dog or any scripting. :)

Share this post


Link to post
Share on other sites

Gotcha. I couldn't remember if there was a dog in original Arma. In Arma 3 they've got one. I'm going to have to see if I can do something with it.

Share this post


Link to post
Share on other sites

At the risk of disappointing a lot of people here, ok a few.....alright, like 1...I think I'm going to have to make the grand leap into ArmA 3. I have just hit an engine limitation with ArmA that sets to cripple my whole idea and open-world premise! Damn you BIS and your gracefully aged and now limiting and debilitating ArmA engine! (LoL, really!)

I dare say, I'm quite dismayed to discover this but equally pleased that I discovered it this early so I didn't wind up wasting extraneous amounts of time beforehand.

Watch for me in the ArmA 3 forums! I know there's some really interesting and promising projects in the works, so maybe I can swoop in and shit all over help out wherever I can! I have many untapped talents...I'm sure of it!...I think......

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  

×