Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.9.1a is out! (05/10/19); Blog post: Skills and Story Points (07/08/19)

Author Topic: Request info for Command point Alterations  (Read 4505 times)

Ranakastrasz

  • Admiral
  • *****
  • Posts: 606
  • Prince Corwin of Amber
    • View Profile
Request info for Command point Alterations
« on: March 28, 2014, 03:18:43 PM »

I am attempting to create a mod altering some aspects of combat, namely the command point system.

I need to be able to do several things and cannot currently locate any examples to work off of.
(If examples exist, would appreciate being pointed at them)

Need to be able to allow command point usage to be freely manipulated. There are a number of conditions for what cost what I want to alter, if possible.
~So as to allow all orders wanted to be issued on warping in, but not once battle is joined.

I need to be able to run a timer in battle to alter command points over time.
Want to also be able to get the timers remainder if a node is captured so as to allow it to be refreshed with the shorter duration.

I need to be able to detect command points being spent, as well as all ships involved, and the type of order.

I need to be able to determine which ship is currently the player/commander.

Want to be able to create a buff that disables a ships's AI while active. It will still continue flying and firing as is at the time.

Logged
I think is easy for Simba and Mufasa sing the Circle of Life when they're on the top of the food chain, I bet the zebras hate that song.

Cigarettes are a lot like hamsters. Perfectly harmless, until you put one in your mouth and light it on fire

dmaiski

  • Captain
  • ****
  • Posts: 422
  • resistance is futile
    • View Profile
Re: Request info for Command point Alterations
« Reply #1 on: March 28, 2014, 04:45:35 PM »

http://fractalsoftworks.com/forum/index.php?topic=7164.0

all you need is there, get reading...

how2StarsectorModdingInOneWeekend
Spoiler
it can be done, but it will take at least a day or two of mad scientist level "must java, eat later, SLEEP LATER, COFFEE!!!!" if you want to get it to work as i imagine you do

searching the forums for answers to specific questions and borrowing ideas for how to do "X" from other mods also helps
(i play SOME mods mostly so i can pull their code and disect it for !!SCIENCE!!)

also get an IDE, i sudgest IDEA just cause its java newbie friendly

once that is done, all thats left is to code what you want, pull a leaver and scream:

[close]


Logged
BISO
(WIP) lots of shiny new weapons ( :-[ i have more weapons then sprites :-[ )

i got a cat pad
its like a mouse pad but better!

Tecrys

  • Captain
  • ****
  • Posts: 478
  • Creator of Biomancy Genetic Engineering
    • View Profile
Re: Request info for Command point Alterations
« Reply #2 on: March 28, 2014, 04:57:26 PM »

http://fractalsoftworks.com/forum/index.php?topic=7164.0

all you need is there, get reading...

how2StarsectorModdingInOneWeekend
Spoiler
it can be done, but it will take at least a day or two of mad scientist level "must java, eat later, SLEEP LATER, COFFEE!!!!" if you want to get it to work as i imagine you do

searching the forums for answers to specific questions and borrowing ideas for how to do "X" from other mods also helps
(i play SOME mods mostly so i can pull their code and disect it for !!SCIENCE!!)

also get an IDE, i sudgest IDEA just cause its java newbie friendly

once that is done, all thats left is to code what you want, pull a leaver and scream:

[close]




Man, I'm glad you're back. I read a lot of the stuff you did so far, you crazy bugger. Really nice to actually see you on the forums.

@Ranakastrasz: You can try to bash code together like I do. Let's say I'm the cave man type of a modder, I put the square through the triangle in kindergarten and even succeed.
But beware, codebashing can be frustrating if stuff doesn't do what you want and you can't tell why which happens more often then not.
Logged
Bringing biological warfare to Stasector since 2014.
Let's say I'm the cave man type of a modder, I put the square through the triangle in kindergarten and even succeed.
Such a stupid thing to quote myself, oh well

Ranakastrasz

  • Admiral
  • *****
  • Posts: 606
  • Prince Corwin of Amber
    • View Profile
Re: Request info for Command point Alterations
« Reply #3 on: March 28, 2014, 08:22:10 PM »

Oh sure, I know it can be frustrating.
Spent tons of time in Warcraft 3 modding, back when it was more active.

Still, it takes a lot more effort when you don't have any existing examples or documentation on what something does already.
If you already have something related, altering it can get your close.

Already had that link, or knowledge of it, and it has been useful in the past. Still can't really figure out ever how the timer type effects work however, which is the largest problem i've had.

Most likely most of that is explained in there.
« Last Edit: March 28, 2014, 08:23:49 PM by Ranakastrasz »
Logged
I think is easy for Simba and Mufasa sing the Circle of Life when they're on the top of the food chain, I bet the zebras hate that song.

Cigarettes are a lot like hamsters. Perfectly harmless, until you put one in your mouth and light it on fire

dmaiski

  • Captain
  • ****
  • Posts: 422
  • resistance is futile
    • View Profile
Re: Request info for Command point Alterations
« Reply #4 on: March 29, 2014, 04:46:34 AM »

Code: java
public class AAA implements YYYPlugin{

    //declare you are using interval util
    private IntervalUtil XXXTimer = new IntervalUtil(Minimum interval, Maximum interval); //in seconds

    //is the timer on or off at the start of the game?
    condition ZZZ =true/false ;

    @Override
    public void advance(float amount){

        if (engine.isPaused()) //so it does not run while game is paused
        {
            return;
        }

        if (condition ZZZ == true) { //will only count time if some condition has been met
        XXXTimer.advance(amount); //will count the time using "amount" wich is basicly frame duration

        //in here also goes you code for while (condition ZZZ == true)
        }

        if (XXXTimer.intervalElapsed())  //timer has reached end
        {
        //your code when timer has ended
        condition ZZZ = false; //optional, ends timing of events untill it is once again set to true
        }

        //if you need it to detect when something has happened to trigger the timer event
        if (NNN = true) //condition that needs to be met for (condition ZZZ = true) only ocurs if (condition ZZZ == false)
        //your code when timer activates
        condition ZZZ = true; //activate timer
        }

    }
}

basics of how to use IntervalUtil
« Last Edit: March 29, 2014, 06:06:26 AM by dmaiski »
Logged
BISO
(WIP) lots of shiny new weapons ( :-[ i have more weapons then sprites :-[ )

i got a cat pad
its like a mouse pad but better!