Author Topic: Function/Feature Requests  (Read 35545 times)

0 Members and 1 Guest are viewing this topic.

Offline m!m

  • 211
Re: Function/Feature Requests
I added a OriginClass variable to the Debris handle to have access to the origin shipclass and a isValid() function as it didn't exist before.
Can a coder please review my changes? :)

[attachment deleted by ninja]

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Function/Feature Requests
Comitted to trunk in rev 7270
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline m!m

  • 211
Re: Function/Feature Requests
Thank you very much :)

 

Offline m!m

  • 211
Re: Function/Feature Requests
I have another patch which adds access to the radius of a debris object.
Nothing big but can someone review it?

[attachment deleted by ninja]

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Function/Feature Requests
Committed as 7354.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline m!m

  • 211
Re: Function/Feature Requests
And I have another patch for some scripting functions:
I added access to the collision information of a weapon by saving the mc_info struct inside the weapon. The critical thing I did was that I needed to allocate the collision information which would be added to the scripting system using new as I can't use a pointer to the struct inside the weapon as the weapon will not be in memory forever. The memory should be freed correctly as I delete the pointer inside the lua __gc function.
I'd like to ask for feedback from a coder whether I broke something or not ;)

[attachment deleted by ninja]

 

Offline Dragon

  • Citation needed
  • 212
  • The sky is the limit.
Re: Function/Feature Requests
Anybody looked into it?
If that patch gets adopted, some interesting things will become scriptable.

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Function/Feature Requests
Patch is in as of revision 7418.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline m!m

  • 211
Re: Function/Feature Requests
I noticed that I missed to add the collision info to the object:checkRayCollision() function where is is very helpful to get additional informations.
Can a coder review it please, it shouldn't break anything and I have tested it :nod:

[attachment deleted by ninja]

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Function/Feature Requests
In as of rev 7512
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

  

Offline m!m

  • 211
Re: Function/Feature Requests
I needed to add another two functions which allow me to manipulate the afterburner data of a ships physics (adding a AfterburnerActive filed to the Physics handle) and an unhackish way to know if a subsystem is a turret or not (added isTurret() to subsystem handle).

The second patch deals with possibly unwanted behavior in the "On Mission Start" hook. There the Player Hookvariable wasn't set although it would be very helpful to have it available. The second thing is that at the time that hook is called the mission is technically not in Mission (the GM_IN_MISSION flag is missing) which causes that most mn.* functions don't work. Currently I need to know the mission filename in that hook but without that flag being set mn.getMissionFilename() always returns an empty string. I "solved" it by temporarily adding the flag when executing the hook and removing it again afterwards but I'm not sure what side effects it has :nervous:

[attachment deleted by ninja]

 

Offline pecenipicek

  • Roast Chicken
  • 211
  • Powered by copious amounts of coffee and nicotine
    • Minecraft
    • Skype
    • Steam
    • Twitter
    • PeceniPicek's own deviantart page
Re: Function/Feature Requests
I would like to request a feature to be able to fire a primary or secondary gunbank on a ship. not the currently selected one as the <ship handle>.firePrimary(<ship handles>) works, but an absolute gb.

basically something like: <ship handle>.firePrimary[<ship handle>,<gunbank index>, ...] and the ability to fire more than one gunbank at once.



or, if thats possible already, can someone just quickly walk me through how to do it?
Skype: vrganjko
Ho, ho, ho, to the bottle I go
to heal my heart and drown my woe!
Rain may fall and wind may blow,
and many miles be still to go,
but under a tall tree I will lie!

The Apocalypse Project needs YOU! - recruiting info thread.

 

Offline m!m

  • 211
Re: Function/Feature Requests
:bump: :nervous:
So did someone take a look at the patches yet?

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Function/Feature Requests
I have them, will take a look later and commit as needed.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline m!m

  • 211
Re: Function/Feature Requests
I have a new patch which adds access to the Viewer_mode as I need to know if the view is currently in the cockpit or not.
I'd be grateful if a coder could take a look at it.

[attachment deleted by ninja]

 

Offline Echelon9

  • 210
Re: Function/Feature Requests
I have a new patch which adds access to the Viewer_mode as I need to know if the view is currently in the cockpit or not.
I'd be grateful if a coder could take a look at it.
Reviewed, and committed to trunk.

 

Offline m!m

  • 211
Re: Function/Feature Requests
Here is a new patch ;)
While working on a script for Diaspora I noticed that the scripting API does contain some sound functions but these function were lacking information which I needed. I also noticed that there were some handle definitions for a soundentry handle and a sound handle which weren't implemented completely. So I just completed those parts and added some new function to the Audio library to use the new handles.
I completed the soundentry handle which represents an entry in sounds.tbl or more precisely an index into the Snds Vector.
This handle can be used to play a sound either normally, looping or in 3D where the 3D function also returns a specialized handle which also gives access to the special 3D functions (currently only one).

Can a coder take a look at it?
Thankyou

[attachment deleted by ninja]

 

Offline m!m

  • 211
Re: Function/Feature Requests
 :bump:
 ;)
Is there anything wrong with it? I really need it for a script for Diaspora...

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: Function/Feature Requests
This thread looks like a good place to post this little patch, which adds a kill() function to asteroids. With this, scripts can actually kill asteroids, whereas previously you'd have needed to spawn a fake weapon to hit and destroy them.

Code: [Select]
Index: lua.cpp
===================================================================
--- lua.cpp (revision 7927)
+++ lua.cpp (working copy)
@@ -4627,6 +4627,30 @@
 
 }
 
+ADE_FUNC(kill, l_Asteroid, "[ship killer=nil, wvector hitpos=nil]", "Kills the asteroid. Set \"killer\" to designate a specific ship as having been the killer, and \"hitpos\" to specify the world position of the hit location; if nil, the asteroid center is used.", "boolean", "True if successful, false or nil otherwise")
+{
+ object_h *victim,*killer=NULL;
+ vec3d *hitpos=NULL;
+ if(!ade_get_args(L, "o|oo", l_Asteroid.GetPtr(&victim), l_Ship.GetPtr(&killer), l_Vector.GetPtr(&hitpos)))
+ return ADE_RETURN_NIL;
+
+ if(!victim->IsValid())
+ return ADE_RETURN_NIL;
+
+ if(killer != NULL && !killer->IsValid())
+ return ADE_RETURN_NIL;
+
+ if (!hitpos)
+ hitpos = &victim->objp->pos;
+
+ if (killer)
+ asteroid_hit(victim->objp, killer->objp, hitpos, victim->objp->hull_strength + 1);
+ else
+ asteroid_hit(victim->objp, NULL,         hitpos, victim->objp->hull_strength + 1);
+
+ return ADE_RETURN_TRUE;
+}
+
 //**********HANDLE: Shipclass
 ade_obj<int> l_Shipclass("shipclass", "Ship class handle");
 extern int ships_inited;

 

Offline Aardwolf

  • 211
  • Posts: 16,384
    • Minecraft
Re: Function/Feature Requests
Ooo, nice one. And you got the optional arguments too!