Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3 4 ... 30

Author Topic: API request thread (please read OP before posting!)  (Read 170022 times)

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1327
    • View Profile
    • GitHub Profile
Re: API request
« Reply #15 on: November 29, 2012, 10:38:30 AM »

Well, you can add that in your library, right? Since your request for a new enum didn't come accompanied with API methods that would actually use it... :)

Heheh, this is turning into a very confusing conversation. Yay for talking past each other.

Hah, you can ignore half of what I say, especially before caffeine. ;)

Also, WeaponAPI lacks a Vector2f getProjectileOrigin().


Lazy, it seems you are a very helpful member of the community In regards to advanced modding, why not do some tutorials?

I tried once, but I don't know what sort of things other modders have trouble with. If there's something you or others need help with, feel free to request a tutorial. Preferably somewhere outside the Suggestions subforum, though. ;)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 17414
    • View Profile
Re: API request
« Reply #16 on: November 29, 2012, 10:51:34 AM »

Added WeaponAPI.getLocation() - returns the pivot point.
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1327
    • View Profile
    • GitHub Profile
Re: API request
« Reply #17 on: December 11, 2012, 04:18:27 PM »

CombatEntityAPI
  • setFacing(float angle)

ShipAPI
  • ShipSystemAPI getSystem()
  • ShipAPI getWingLeader()
  • boolean isWingLeader()

Will the new setOwner() in CombatEntityAPI allow projectiles to harm the one who fired them if used on a DamagingProjectileAPI? I've noticed that redirected projectiles just pass harmlessly through their source ship at the moment.

Edit: Also, would it be possible to create a way to hide a ship using FogOfWarAPI?
« Last Edit: December 11, 2012, 04:23:12 PM by LazyWizard »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 17414
    • View Profile
Re: API request
« Reply #18 on: December 11, 2012, 04:36:36 PM »

CombatEntityAPI
  • setFacing(float angle)

ShipAPI
  • ShipSystemAPI getSystem()
  • ShipAPI getWingLeader()
  • boolean isWingLeader()

Thank you - noted, will add.

Will the new setOwner() in CombatEntityAPI allow projectiles to harm the one who fired them if used on a DamagingProjectileAPI? I've noticed that redirected projectiles just pass harmlessly through their source ship at the moment.

Edit: Also, would it be possible to create a way to hide a ship using FogOfWarAPI?

Hmm, that's a good point. I'll add a "setSource()" method to DamagingProjectileAPI - right now, projectiles - except for flamed-out missiles - can't hit the launching ship.

Re: fog of war - probably not. Just not set up for it.
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1327
    • View Profile
    • GitHub Profile
Re: API request
« Reply #19 on: December 12, 2012, 09:02:09 PM »

CombatEngineAPI:
  • spawnBeam(ShipAPI ship, WeaponAPI weapon, String beamId, Vector2f start, Vector2f towards) (or something similar)

WeaponAPI:
  • setAmmo(int amount)

Edit: could our combat plugins have a method called when the battle ends?
« Last Edit: December 12, 2012, 09:27:01 PM by LazyWizard »
Logged

xenoargh

  • Admiral
  • *****
  • Posts: 4882
  • naively breaking things!
    • View Profile
Re: API request
« Reply #20 on: December 12, 2012, 09:12:00 PM »

Oh, yes, please let me spawn beams.  Lightning-guns of Stunning +10, for great justice!
Logged
Please check out my SS projects :)
Xeno's Mod Pack

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: API request
« Reply #21 on: December 13, 2012, 01:57:46 AM »

CombatEngineAPI:
  • spawnBeam(ShipAPI ship, WeaponAPI weapon, String beamId, Vector2f start, Vector2f towards) (or something similar)

WeaponAPI:
  • setAmmo(int amount)

Edit: could our combat plugins have a method called when the battle ends?

+1 to both, especially the Weapon API one, That way it would be possible to make a support vessel that regens ammo in a specific radius, If it worked like:

setAmmo(int amount)
setAmmoAura(ShipAPI ship, decimal radius, int amount/s)
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 17414
    • View Profile
Re: API request
« Reply #22 on: December 13, 2012, 10:12:12 AM »

Beam spawning isn't an option due to how the engine works. A beam requires a ship and a weapon and all that, and you can't just pass in some weapon and have it work.

Ultimately, the way to do it would be to spawn an invisible ship armed with a hidden beam weapon fire it, but that requires being able to code up a custom ship AI, which you can't yet.



I'll add setAmmo(), though.
Logged

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: API request
« Reply #23 on: December 13, 2012, 10:23:44 AM »

Beam spawning isn't an option due to how the engine works. A beam requires a ship and a weapon and all that, and you can't just pass in some weapon and have it work.

Ultimately, the way to do it would be to spawn an invisible ship armed with a hidden beam weapon fire it, but that requires being able to code up a custom ship AI, which you can't yet.



I'll add setAmmo(), though.
I believe next release will be a massive moddable pack, which I say is epic
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1327
    • View Profile
    • GitHub Profile
Re: API request
« Reply #24 on: December 13, 2012, 12:42:58 PM »

Beam spawning isn't an option due to how the engine works. A beam requires a ship and a weapon and all that, and you can't just pass in some weapon and have it work.

Ultimately, the way to do it would be to spawn an invisible ship armed with a hidden beam weapon fire it, but that requires being able to code up a custom ship AI, which you can't yet.

Hmm, what about just spawning the beam effect? You would just specify the start and end points, along with the weapon ID so it can grab the appearance and (if possible) the collision tags, and the engine draws a beam between those points. Something like addBeamEffect(Vector2f startPoint, Vector2f endPoint, String beamSpecId, boolean noCollide). Even if it's non-damaging, it would be useful as special effects for some shipsystem ideas I've been working on.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 17414
    • View Profile
Re: API request
« Reply #25 on: December 13, 2012, 01:26:48 PM »

Right, that's possible... but would not be reusing much of what's already there - rather, it'd be an entirely new feature. I'll keep it in mind, though - has some cool possibilities, especially if the beams could be collidable (yet another new feature...)
Logged

Wyvern

  • Admiral
  • *****
  • Posts: 2593
    • View Profile
Re: API request
« Reply #26 on: December 13, 2012, 01:49:20 PM »

Collideable beams?  Ooh, we could make Tron lightcycles with that!
Logged
Wyvern is 100% correct about the math.

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 17414
    • View Profile
Re: API request
« Reply #27 on: December 13, 2012, 01:55:02 PM »

Well, in theory, I think you could already do something like that.

Create some invisible hulls for use as the "lines", deploy them where you want, and have some code run continuously to keep them in place, and spawn some particle effects to make them visible.

The "lines as ships" part may cause some side effects, such as them showing up in the post-battle report or perhaps even being boardable. Still, could work out for missions.

Hmm. I'll see about adding a "spawnShipOrWing" method where it won't do that.
Logged

Hyph_K31

  • Admiral
  • *****
  • Posts: 1605
  • O' Hear My Name and Tremble! Ug Ug.
    • View Profile
Re: API request
« Reply #28 on: December 13, 2012, 02:00:36 PM »

Huh, the idea of light trails reminds me of something I had suggested a long while ago:

With regards to missiles, would a new contrail type similar to a tracer trail be possible? It's not exactly on topic, but I was reminded and I think it would be a rather cool thing to have.
Logged

"GEDUNE, stop venting in front of your classmates!"

Sproginator

  • Admiral
  • *****
  • Posts: 3592
  • Forum Ancient
    • View Profile
Re: API request
« Reply #29 on: December 13, 2012, 02:02:40 PM »

Well, in theory, I think you could already do something like that.

Create some invisible hulls for use as the "lines", deploy them where you want, and have some code run continuously to keep them in place, and spawn some particle effects to make them visible.

The "lines as ships" part may cause some side effects, such as them showing up in the post-battle report or perhaps even being boardable. Still, could work out for missions.

Hmm. I'll see about adding a "spawnShipOrWing" method where it won't do that.

Could you implement a GrabObject method?

For instance a ship could bump an asteroid and equip it as ammo, then fire it as a weapon
Logged
A person who's never made a mistake, never tried anything new
- Albert Einstein

As long as we don't quit, we haven't failed
- Jamie Fristrom (Programmer for Spiderman2 & Lead Developer for Energy Hook)
Pages: 1 [2] 3 4 ... 30