Author Topic: BC 1.1 - Secondary shield generators  (Read 5140 times)

Offline Defiant

  • Posts: 398
  • Cookies: 1105
    • BC: Kobayashi Maru
Re: BC 1.1 - Secondary shield generators
« Reply #20 on: September 16, 2011, 09:21:04 AM »
Enabled for all ships with more then one shield generator.

Offline KrrKs

  • Posts: 461
  • Cookies: 25
Re: BC 1.1 - Secondary shield generators
« Reply #21 on: September 16, 2011, 09:25:50 AM »
I think there is a build in Function in App that returns true if a specified System is disabled.

Quote
Does the ShieldGenerators.py script in the QBautostart folder apply to all ships?
- Yes.
However, you can find out a Ships Script Name with (I guess it is a MissionLib Function):  
Quote
pShip.GetScript()
So you can Check all Ships in a Set and only use your Script if the ScriptName is right.

Quote
Additionally, I am assuming that the script is continuously executed in order to work
In Essence yes. It is fired by certain Eventhandlers.

Offline Bat66wat6

  • Posts: 144
  • Cookies: 34
  • Running custom BC 1.1
Re: BC 1.1 - Secondary shield generators
« Reply #22 on: September 16, 2011, 02:37:37 PM »
Okay thanks, I now have a better understanding of how BC executes QBautostart scripts.

I have been going over the Python documentation & tutorials, if I can find the right functions I think there is a serious chance of being able to pull this script off and achieve the in-game result I want.

It's a matter of being able to differentiate between Primary and Secondary shield generators, as
well as being able to store their shield values when they go offline. I am confident there is a way.

Additionally I want to let you know that your current script has a glitch in it. When the game is running in Test Mode and you use CTRL+SHIFT+R to instantly repair the ship the shields do not come back. However the script works fine when the AI repairs the shield normally so it isn't that bad...
Great men are not peacemakers! Great men are conquerors!

Offline ACES_HIGH

  • BCC Roleplay Game Narrator
  • Moderator
  • Posts: 1678
  • Cookies: 54
  • while(!(succeed=try()));
    • BCC Roleplay Games
Re: BC 1.1 - Secondary shield generators
« Reply #23 on: September 16, 2011, 09:30:11 PM »
one major hurtle that you might face is that the BC AI doesn't usually attack the shield generator directly, so chances are, the shields will be knocked out well before the generator suffers enough damage to trigger the script to swap to the auxiliary shield generator.

Offline Bat66wat6

  • Posts: 144
  • Cookies: 34
  • Running custom BC 1.1
Re: BC 1.1 - Secondary shield generators
« Reply #24 on: September 17, 2011, 06:36:01 AM »
True.

I haven't even thought how the AI targets sub-systems. The AI in this game seems very simplistic because they just tend to exclusively target weapons above all else.

However right now I am not particularly concerned how the AI goes about attacking me, my priority is to get the Primary-Secondary shield generator script to work how I want it.
Great men are not peacemakers! Great men are conquerors!

Offline flarespire

  • The one who breaks the cycle.
  • Posts: 1230
  • Cookies: 47
  • God Green God Dammit!
Re: BC 1.1 - Secondary shield generators
« Reply #25 on: September 17, 2011, 01:46:16 PM »
maybe you could add a new algorythm to the QB enemy AI which makes them target a ship and something on that ship at random? that may make this secondary shield thing usefull....

Offline Defiant

  • Posts: 398
  • Cookies: 1105
    • BC: Kobayashi Maru
Re: BC 1.1 - Secondary shield generators
« Reply #26 on: September 17, 2011, 02:04:32 PM »
That would make he AI Target things like Shuttle Bays or warp engines.

Offline flarespire

  • The one who breaks the cycle.
  • Posts: 1230
  • Cookies: 47
  • God Green God Dammit!
Re: BC 1.1 - Secondary shield generators
« Reply #27 on: September 17, 2011, 02:19:25 PM »
exactally...so that would make this secondary shield idea a bit more usefull than just implimenting it.

Offline Bat66wat6

  • Posts: 144
  • Cookies: 34
  • Running custom BC 1.1
Re: BC 1.1 - Secondary shield generators
« Reply #28 on: September 17, 2011, 06:19:53 PM »
I am running through Python 2.4 documentation.
Regardless of how useful my implementation of the primary secondary shield problem seems I intend to pursue it through to the end.

The AI problem isn't my first priority. Besides, I am under the impression that AI (even apparently simplistic) is not easy to create nor is it easy to change.
Great men are not peacemakers! Great men are conquerors!

Offline jayce

  • Posts: 20
  • Cookies: 2
Re: BC 1.1 - Secondary shield generators
« Reply #29 on: September 17, 2011, 08:24:58 PM »
for testing purposes, you could forget about the ai. on your shield generator test ship, just temporarily change the hardpoint of the shield generators. for example, increase the radius of the generator property so that its length/width/height are all larger than the ship itself. also make sure that the generator property is easily disableable. this way, when testing in-game, the generator property would be the first thing to get damaged. this would be a lot easier for you to do than trying to adjust the ai unless

Offline flarespire

  • The one who breaks the cycle.
  • Posts: 1230
  • Cookies: 47
  • God Green God Dammit!
Re: BC 1.1 - Secondary shield generators
« Reply #30 on: September 18, 2011, 06:55:34 AM »
the bc engine doesnt work like that, you actually have to have an enemy target your primary shield generator for the right amount of damage to happen, but the enemy AI usually just target the ship in general.

Offline Defiant

  • Posts: 398
  • Cookies: 1105
    • BC: Kobayashi Maru
Re: BC 1.1 - Secondary shield generators
« Reply #31 on: September 18, 2011, 04:21:46 PM »
The BC AI does Target subsystems. It even has a complex rating algorithm (Preprocessors.py).

Offline flarespire

  • The one who breaks the cycle.
  • Posts: 1230
  • Cookies: 47
  • God Green God Dammit!
Re: BC 1.1 - Secondary shield generators
« Reply #32 on: September 18, 2011, 06:00:00 PM »
hmm...maybe we could make it rate the primary shield higher?

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
Re: BC 1.1 - Secondary shield generators
« Reply #33 on: September 18, 2011, 07:14:17 PM »
not really...

Offline Bat66wat6

  • Posts: 144
  • Cookies: 34
  • Running custom BC 1.1
Re: BC 1.1 - Secondary shield generators
« Reply #34 on: September 19, 2011, 05:47:17 AM »
So...the AI was just as complex and hard to understand as I initially thought, huh? :nono:

On another note I'm progressing through the documentation nicely and am surprised by the Python language. When I first heard about it I considered it little more than a scripting language. I am surprised by its extensibility, I can see why the developers at Totally Games chose it.

Just one thing. Why the hell are Lambda forms in the language? Functions that are syntactically restricted to one expression, I don't see how they could be of any use.  :lostit: It confuses me that part of another language is incorporated into this one...

Other than that so far it's all good stuff in Python 2.4 Documentation.  :)
Great men are not peacemakers! Great men are conquerors!

Offline Defiant

  • Posts: 398
  • Cookies: 1105
    • BC: Kobayashi Maru
Re: BC 1.1 - Secondary shield generators
« Reply #35 on: September 19, 2011, 08:34:23 AM »
On another note I'm progressing through the documentation nicely and am surprised by the Python language. When I first heard about it I considered it little more than a scripting language. I am surprised by its extensibility, I can see why the developers at Totally Games chose it.
A lot of people use it. Google for example. Its a good language for rapid prototyping.

Just one thing. Why the hell are Lambda forms in the language? Functions that are syntactically restricted to one expression, I don't see how they could be of any use.  :lostit: It confuses me that part of another language is incorporated into this one...

Other than that so far it's all good stuff in Python 2.4 Documentation.  :)
Why not? Just note that BC is Python 1.5. It can't do all the stuff of 2.x

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2187
  • Cookies: 1706
  • Life is life
Re: BC 1.1 - Secondary shield generators
« Reply #36 on: September 19, 2011, 11:31:41 AM »
It even has a dotnet implementation on top of DLR called IronPython. Not to mention that it's really popular scripting interface. BC is not the only game to use python as a scripting language, Civ 4 also used it. I know a few companies which use IronPython to develop business applications, main program performs operations on the data while ironPython scripts contains the BL.
Acta, non verba.
aka USS Sovereign

Offline Bat66wat6

  • Posts: 144
  • Cookies: 34
  • Running custom BC 1.1
Re: BC 1.1 - Secondary shield generators
« Reply #37 on: September 19, 2011, 02:02:01 PM »
Just note that BC is Python 1.5. It can't do all the stuff of 2.x

Are you sure of this? I based my decision when downloading Python on the sticky thread "Becoming A Scripter 101"

Quote from: USS Sovereign
Python, which can be downloaded from python.org. I strongly recommend downloading no higher than v2.5.
Great men are not peacemakers! Great men are conquerors!

Offline Defiant

  • Posts: 398
  • Cookies: 1105
    • BC: Kobayashi Maru
Re: BC 1.1 - Secondary shield generators
« Reply #38 on: September 19, 2011, 02:16:38 PM »
Yes, I'm sure.

Still newer Version is usually better (Bugs fixed, better compatibility with new Windows versions etc). Especially if you want to use Python for other stuff, outside BC.

Sov: Why not higher then 2.5? (Or does it refer to 3.0?)

Offline Mario

  • Senior Software Developer
  • Administrator
  • Posts: 2187
  • Cookies: 1706
  • Life is life
Re: BC 1.1 - Secondary shield generators
« Reply #39 on: September 19, 2011, 03:19:51 PM »
Goal was to obtain the version closest to 1.5. Obviously 1.x and some 2.x have certain problems running on Vista\7 so I recommended a version up to 2.5. In all honesty 2.5\2.6 have a lot of deprecated modules. So you kind of see my dilemma. For BC you don't go for the latest you go for the closest you can get to BC's version. Not to mention that you can have multiple python versions installed.
Acta, non verba.
aka USS Sovereign