Comments (8)
i think that _difficil is the same only because it was an initial copypaste... however each mission might be improved and with different conditions after the mission core is done (this is still alpha).
So, making a well shaped function will then take time to also specify differences in the moment they're going to be coded.
In my point of view: core has to be DRY... let me mention: undercover, spawn/despawn, win/loose, etc.
So we have a scaffold that is solid and easy to read, and based on that we can add the specific subcategories that can actually be less shaped considering it's a mission of few mb and not a mod itself.
Also i'd give priority to parameters: it should be simple understand what is passed and how to call/spawn a function
from a3-antistasi.
Well, I would start to build some basic functions like: [_soldiers, _marker] call isAbleToConquer > 3*([allUnits,_marker] call isAbleToDefend), or [_soldier] call isAbleToFight (not unconscious, alive, not captive, not fleeing), thos will simplify a lot of things.
from a3-antistasi.
One way I've learned to make "classes" and "objects" in SQF is:
- Create any object which can be treated with setVariable and getVariable, like a logic unit or an object with a simple 3D model which you can later hide.
- Then treat it like any object in OOP, make a "constructor", "destructor" for it and "methods" as usual functions.
It definitely gives a boost to code flexibility, also keeps it more organized. But I have also found that the more objects like this you've created the longer time it takes to create a new one, simply the limitation of an engine(it's 10's of microseconds, IIRC, but still), and the (get/set)Variable performance might drop, so these objects shouldn't be created for every sneeze of your soldier.
OOP approach is good for "entities" that need to do some kind of processing with ability to spawn many of them, like you create a "mission" object, it instantly initiates needed data for the mission, markers, etc, and spawns a thread to monitor the mission execution. Now you can spawn as many as you like and do whatever with them and they will never interfere.
from a3-antistasi.
Maybe this repo can give you some insperation: https://github.com/dwringer/a3system
Found after some quick searching on github.
Love the work you put into Antistasi so maybe this will eventually help.
from a3-antistasi.
As I know SQF doesn't support classes (don't confuse with classes in .cfg files) or object-oriented things without extentions. Do you use some extention to get class support?
from a3-antistasi.
Hum i see, so https://community.bistudio.com/wiki/Class_Inheritance is only for config files ? i cry :(
But i think we still can have a more object-oriented code (or at least DRY), simply on mission files i can see that all this dificil condition is repeated, this should be refactored in a function (or at least mooved into a isDificil.sqf file and then included) and also get a linter on it.
We call also look at some plugins to do that like this one.
from a3-antistasi.
Actually looks like OOP is not a real thing in SQF :/
I found this guide where some ideas can be applied for better readability : https://ace3mod.com/wiki/development/coding-guidelines.html
from a3-antistasi.
Enfusion (DayZ and high chance arma 4) will support it \o/
I close because issue name actually is irrelevant to project.
from a3-antistasi.
Related Issues (20)
- Convoys self imploding on chernarus_summer ww2 HOT 1
- [bug] Freshly pulled vehicles do not retract into the garage. HOT 2
- [bug] Dialog back button HOT 2
- missing Faction line buenosVanillaAltisB.sqf HOT 2
- [bug] City Supplies mission HOT 1
- [bug] Vehicle shop HOT 5
- [AI suggestion] AI shouldn't dismount an AA/AT truck after losing a few tires HOT 1
- Antistasi medical not turning off HOT 1
- [suggestion] Vehicle Load Out From Arsenal
- [bug] Players Freeze - Armia Krajowa HOT 6
- Error in inmuneConvoy.sqf HOT 1
- Vechiles not saved when captured and info
- rearming ai from arsenal issue? HOT 1
- Bug in AI medic assignment. HOT 1
- [bug] Disconnected Headless Clients not being removed from array. HOT 1
- Is this repo still active? HOT 6
- Chinese Translation HOT 2
- Variable names in Spanish HOT 1
- Personal Garage
- Ccxcc
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from a3-antistasi.