Need some help.
Moderator: Moderators
Need some help.
I have a few questions and would appreciate some help.
1)
I need to add a gauge to units that will gradualy fill itself when the unit is within a certain radius of a building and will empty when the unit is being shot at.
Also if a unit has its gauge full for x amount of time if it leaves the radius of the buildings and gets shot at it it's gauge wont start falling for a while(but if it didnt have a maxed gauge long enough it will start dropping as soon as it leaves the redius and gets shot at).
Units with an empty gauge will need to become slower and less accurate.
2)
I need to have a system of "electric supply".
There will be a headquartrs and from it you will have to build power lines and each of them will have a certain radius on which u can build another powerline so they get connected plus some buildings should only be allowed to be built on the radius of a powerline from a
certain list for which you dont need a builder(like c&c).
3)
I need some buildings to be allowed to build in the same c&c style only if they are in a certain radius from a unit.
4)
i need to be able to have a building outomaticly create a vehicle which will outomaticly collect "wounded" troops and drive them to the building where they heal than get driven back to where they were first loaded ot another specified location.
Now,most of it is probably lua if not all of it so if anyone has lua code that resembles such things and might help me i will appreciate if you send it to me or post it here or whatever.
Thx in advance.
1)
I need to add a gauge to units that will gradualy fill itself when the unit is within a certain radius of a building and will empty when the unit is being shot at.
Also if a unit has its gauge full for x amount of time if it leaves the radius of the buildings and gets shot at it it's gauge wont start falling for a while(but if it didnt have a maxed gauge long enough it will start dropping as soon as it leaves the redius and gets shot at).
Units with an empty gauge will need to become slower and less accurate.
2)
I need to have a system of "electric supply".
There will be a headquartrs and from it you will have to build power lines and each of them will have a certain radius on which u can build another powerline so they get connected plus some buildings should only be allowed to be built on the radius of a powerline from a
certain list for which you dont need a builder(like c&c).
3)
I need some buildings to be allowed to build in the same c&c style only if they are in a certain radius from a unit.
4)
i need to be able to have a building outomaticly create a vehicle which will outomaticly collect "wounded" troops and drive them to the building where they heal than get driven back to where they were first loaded ot another specified location.
Now,most of it is probably lua if not all of it so if anyone has lua code that resembles such things and might help me i will appreciate if you send it to me or post it here or whatever.
Thx in advance.
Re: Need some help.
Number 2 is pretty close to something in Fiber
Re: Need some help.
3 is fairly easy LUA.
1 and 4 are both possible, but are going to be extremely problematic.
1 will require that you build a nice-looking guage, that that gauge code reads a variable state for a given Unit.
Based on what you're describing, I'd probably use COB to store the state of the "charge", it'd be faster in terms of keeping track, and you could have LUA query COB and return the current value every SlowUpdate or so, if the guage was being displayed.
I don't know a lot about building custom guages, but I know that Fibre has a custom display, CA has buttons that use OpenGL to change their colors, and Zpock's been working on something involving a host of custom gauges, maybe he'll share with you, if you have a demo to show us that you actually have some content to use this with.
4 is a lot harder. Creating a vehicle... no problem. Giving that vehicle orders... no problem. Getting the vehicle to go collect the "wounded"... well, that really depends on how you want to handle this. You could send the "ambulance" to a location near the "wounded", then make the "wounded" disappear, however that brings up a number of technical problems. The "wounded" could just be your stock guys, doing an endless loop in their Killed() function, but I'm not sure if you can break out've Killed() when they're healed. Probably, they'd have to be sent a signal from LUA, that'd cause them to disappear and be replaced with a new version of the dead guy. That part isn't very hard.
1 and 4 are both possible, but are going to be extremely problematic.
1 will require that you build a nice-looking guage, that that gauge code reads a variable state for a given Unit.
Based on what you're describing, I'd probably use COB to store the state of the "charge", it'd be faster in terms of keeping track, and you could have LUA query COB and return the current value every SlowUpdate or so, if the guage was being displayed.
I don't know a lot about building custom guages, but I know that Fibre has a custom display, CA has buttons that use OpenGL to change their colors, and Zpock's been working on something involving a host of custom gauges, maybe he'll share with you, if you have a demo to show us that you actually have some content to use this with.
4 is a lot harder. Creating a vehicle... no problem. Giving that vehicle orders... no problem. Getting the vehicle to go collect the "wounded"... well, that really depends on how you want to handle this. You could send the "ambulance" to a location near the "wounded", then make the "wounded" disappear, however that brings up a number of technical problems. The "wounded" could just be your stock guys, doing an endless loop in their Killed() function, but I'm not sure if you can break out've Killed() when they're healed. Probably, they'd have to be sent a signal from LUA, that'd cause them to disappear and be replaced with a new version of the dead guy. That part isn't very hard.
Re: Need some help.
OK.
About the gauges.
Arent the ones that appear say when a unit is reloading when you have the healbar widget on are the same as what i am requesting?
I can just take those change their color and add them as permanant gauges?
About the dead guys.
Cant i just make them become paralyzed?and than the vehicle takes them and brings them back normal.I also need them to retain their experiance.
And can there be 2 types of paralyzations?since there is a weapon that causes unit to become paralyzed and i dont want the two to mix and the ambulance taking the normaly paralyzed units.
About the gauges.
Arent the ones that appear say when a unit is reloading when you have the healbar widget on are the same as what i am requesting?
I can just take those change their color and add them as permanant gauges?
About the dead guys.
Cant i just make them become paralyzed?and than the vehicle takes them and brings them back normal.I also need them to retain their experiance.
And can there be 2 types of paralyzations?since there is a weapon that causes unit to become paralyzed and i dont want the two to mix and the ambulance taking the normaly paralyzed units.
Re: Need some help.
Could #1 be done as a physical model part of the unit? That is, you have an actual "gauge" piece that floats over the unit and expands and contracts depending on status (and gets turned invisible/replaced with yellow and red versions to show when running low)?
Re: Need some help.
I suppose, if they were paralyzed, they could be un-frozen. However, that implies that you'll never be killing them 
Seriously, no, you're going to have to kill them. Storing their experience, etc., is not going to be the problem, the problem's going to be having the ambulance doing stuff that makes sense, and graphical handling of the events.

Seriously, no, you're going to have to kill them. Storing their experience, etc., is not going to be the problem, the problem's going to be having the ambulance doing stuff that makes sense, and graphical handling of the events.
Re: Need some help.
I dont need to kill them,they can go to prone mod which they can do and than for example flash with a red color showing that they are paralyzed(injured).My question is can i make 2 different typs od paralyzation..so units can be actually paralyzed and than after a teim recover by themselves and they can be paralyzed in the sens of being injured and need to be healed.
What i need from the ambulance visually is for it to drive near those troops and they will vanish into it..than it goes to the medical center and than drives them back to the battlefield to a specified location..the ambulance needs to do it outomaticly with all injured troops in the medical center's radius.
What i need from the ambulance visually is for it to drive near those troops and they will vanish into it..than it goes to the medical center and than drives them back to the battlefield to a specified location..the ambulance needs to do it outomaticly with all injured troops in the medical center's radius.
Re: Need some help.
" However, that implies that you'll never be killing them " what do you mean? I am not killing them..they become injured..
Re: Need some help.
He means your units won't ever be killed this way. They will become 'injured', but never 'dead'.
Re: Need some help.
I think what he's trying to say is that you are talking like the units would never actually die, you would just paralyze them instead of them actually taking damage... It sounds like you are saying units would never die, they would just become injured and be picked up later to be healed... this is not how most RTSs work.
Anyways, the short answer to your questions is that everything you've described could be done with clever enough LUA and COB...
Anyways, the short answer to your questions is that everything you've described could be done with clever enough LUA and COB...
Re: Need some help.
Here's the question: do you want other units to continue firing on your injured units until dead? Or are injured units effectively out-of-play until "rescued"? If the latter, then it's probably best to implement the "injury" as "death" and simply persist any features that you want persisted on the unit when it is "healed" somewhere else in code - to the user, it would look the same.Gota wrote:" However, that implies that you'll never be killing them " what do you mean? I am not killing them..they become injured..
You see? Whether the unit is dead or alive is an implementation detail - much like how lots of tricky "towers" in mods are actually mobile units that just don't move.
Re: Need some help.
IOW, paralyzing them won't be a good solution. Sorry, I should have just said that, I haven't had any sleep in way too long, I'm getting into smartass territory 
Instead of paralyzing them, you'd probably want to have them either become Features which get resurrected by your ambulance (this is the easiest way, but wouldn't look convincing), or you could convert them to Neutral units via LUA, which would keep enemies from attacking them, and jam their aiming scripts, etc. so they'd stay "injured". You could even fancy stuff up a bit- make it so that if they stay "wounded" for too long, they finally really die, among other things...

Instead of paralyzing them, you'd probably want to have them either become Features which get resurrected by your ambulance (this is the easiest way, but wouldn't look convincing), or you could convert them to Neutral units via LUA, which would keep enemies from attacking them, and jam their aiming scripts, etc. so they'd stay "injured". You could even fancy stuff up a bit- make it so that if they stay "wounded" for too long, they finally really die, among other things...
Re: Need some help.
I was thinking the prettiest way to do it was to have the units loaded into the ambulance, and then do whatever unlock script and then automatically unload it back to it's original position.
Re: Need some help.
OK...I need some x percentage to get paralyzed instead of dying..
say 30 for example.
And again,i do need the ambulance to go back ot the medical station and say stay near it for y amount of time than go back and put the soldiers back fully healed..
Anyway.. I understand,all is doable and ill guess ill ask kdr for some help since he has c&c build style implemented and he has nodes which is like my "power lines".
say 30 for example.
And again,i do need the ambulance to go back ot the medical station and say stay near it for y amount of time than go back and put the soldiers back fully healed..
Anyway.. I understand,all is doable and ill guess ill ask kdr for some help since he has c&c build style implemented and he has nodes which is like my "power lines".
Re: Need some help.
could the ambulance not just be a transporter that rushes out brings it back at low health.
- Felix the Cat
- Posts: 2383
- Joined: 15 Jun 2005, 17:30
Re: Need some help.
That would be the easy way, but I don't think it's what Gota's looking for.ironized wrote:could the ambulance not just be a transporter that rushes out brings it back at low health.