Jump to content

X2 scripting questions


L31ghT

Recommended Posts

Hello!
I'am trying to override "SimpleFire" abillity to make all soldiers shots hit always. (btw , does overrided class completely replacing original one if i keep almost same code in it?)
I've made a class that extends SimpleFire, copied all the code from original and made my changes.
Project compiled with no errors.
I found that exact line in code and copied a working code from "always hit" cheat condition just below but... overrided class doesn't works ingame (mod enabled in launcher), so i trying to `log my code for debug purpose, but here is a problem.
Where can i see " `logs "? There is "ShowLog" console function but there are no logs here (it does opens a console window , but still nothing usefull there), even from original code.
+ i tried to launch debugging but overy time i try - it launches a game, debugger tries to connect for some time and returns an error "Error eccured with code (0x0)" to my modBuddy log.
Does anyone had some progress with actual code debugging?
Thanx for ur time!

 

Link to comment
Share on other sites

Overriding a class means you are replacing its functionality(and you will need to provide the same interface that already exists for it plus whatever you want to add). Not all classes can be overridden or extended from what I have seen.

 

Conversly you can extend a class, which will allow you to add your own functionality, but it retains its original functionality and interface.

 

A 'better' way for you to accomplish this, just set the class stat for aim to some crazy number like 300 in the ini and start a new game(they will be very unlikely to hit).

Link to comment
Share on other sites

Thanx for your reply!

 

 

A 'better' way for you to accomplish this, just set the class stat for aim to some crazy number like 300 in the ini and start a new game(they will be very unlikely to hit).

Ok, that's a fair idea, thanks.

Well, I've eventually wanted to make a custom ability that always hits, but deals damage according to shooters accuracy.

For instance, if i have max damage value of 10 and my accuracy is 30%, this ability should deal 3hp damage to the target.
Link to comment
Share on other sites

 

Thanx for your reply!

 

 

A 'better' way for you to accomplish this, just set the class stat for aim to some crazy number like 300 in the ini and start a new game(they will be very unlikely to hit).

Ok, that's a fair idea, thanks.

Well, I've eventually wanted to make a custom ability that always hits, but deals damage according to shooters accuracy.

For instance, if i have max damage value of 10 and my accuracy is 30%, this ability should deal 3hp damage to the target.

 

Thats an interesting idea, personally I think it would be way too strong given you can easily get pretty decent accuracy, but late game it would fall off to barely usable(unless damage is scaled).

 

This actually could be done, I'd suggest looking at the code for null lance(or whatever that psi ability is that always hits).

Link to comment
Share on other sites

 

Thats an interesting idea, personally I think it would be way too strong given you can easily get pretty decent accuracy, but late game it would fall off to barely usable(unless damage is scaled).

 

This actually could be done, I'd suggest looking at the code for null lance(or whatever that psi ability is that always hits).

 

It's not for campaine game - i had an idea of specific tournament oriented multiplayer mod with no random and some rabalance stuff.

So, will try to implement this if i can)

Thanx for u tips - will search for this class!

 

Edited by L31ghT
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...