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

0 Members and 1 Guest are viewing this topic.

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Function/Feature Requests
Indeed.

That said, submitting patches is A-1 SUPAR and I don't think I have any objections to adding the one Keldor posted.  But it's important to try to find a pre-existing solution before coding up something new.  Especially if it's redundant.

 

Offline Aardwolf

  • 211
  • Posts: 16,384
    • Minecraft
Re: Function/Feature Requests
*AHEM*

There's only a few things that can be done with FRED that can't be done with scripting (especially now that we have the runSEXP function).

Among them: waypoints. Although there are a few types and functions relating to waypoints, it's impossible to create waypoint paths, and there's no SEXP to do it either; waypoint paths have to be placed in FRED before they can be used.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Function/Feature Requests
as dead and as old as this thread is i think il post a couple things here that scrpiting really needs.

ai library - for access to ai related data, so you can have some degree of control over what the ai does (like setting the kamekazi flag when an enemy ship runs out of ammo).
ui library - for access to data which would normally be edited by the hard coded user interface, the purpose of this would be mainly for scripted ui replacement.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Function/Feature Requests
Having those libs alone wont help any one.. they need some content to fill them as well
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Function/Feature Requests
i could probibly add the content myself as i made progress on the ui. it would certainly help resolve this situation. ai is less important right now, but its something i may need in the near future. im just not sure how to add new libraries to the scripting system. if someone started them and added a couple of examples, i could quickly populate them.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Wanderer

  • Wiki Warrior
  • 211
  • Mostly harmless
Re: Function/Feature Requests
Something akin to...
Code: [Select]
//**********LIBRARY: Controls library
ade_lib l_HUD("HUD", NULL, "hu", "HUD library");

Perhaps?
Do not meddle in the affairs of coders for they are soggy and hard to light

 

Offline m!m

  • 211
Re: Function/Feature Requests
 :bump:
Bumping this because I have some ideas about scripting functions:

mn.objectFromScreenPos(x, y[, depthOffset=0])
Returns a handle to the object or invalid handle when there is no object. Optionally takes an argument for a minimum distance the object should have

subsystem:rotateTurret(vector woldPos)
Rotates the turret to face worldPos.

But I also wrote some additions myself, see attached patches.
Things I added:
  • A $On Weapon Creation: hook that gets called when a weapon is created
  • Types for thruster information on a model
  • Variables for Model and FreeFlightTime in weaponclass
  • Function to determine the type of a weapon in weaponclass (laser, missile or beam)
  • A function in subsystem to determine the normalized forward vector of a turret
  • Functions for getting information on slash direction in the beam type
Could someone please review those patches and tell me what I did wrong? :D

Regards,
m!m

EDIT: NOTE TO SELF: Check if patch actually compiles :banghead:
And the new version contains a variable for weaponclass that checks if the class is flagged as a bomb.

[attachment deleted by ninja]
« Last Edit: February 12, 2011, 02:55:03 pm by m!m »

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Function/Feature Requests
lots of stuff there i like.

not quite sure i understand what objectFromScreenPos is supposed to do. if its supposed to find ships on the screen, that is something i would have done with a frustum cull and so that kinda saves some time (and maths).

up till now i mostly aimed turrets by setting the orientation of the base and barrel models, then called fireWeapon(). trouble there was you had to somehow tell the script which turrets were single part, which where 2 part, and also i dont believe the base orientation is accessible from anywhere (u/fvec would have needed to be accessible, then used to compute a matrix), so you would essentially have to guess as to whether the turret was upper or lower, and turrets at angles were all but impossible.  being able to do it with one function call really speeds things up.

$On Weapon Creation: sounds like a pretty nice hook to have. though i kinda wish it was object level (so that it could apply to any object derivative). would definitely be a good way to initialize meta for weapons though.

lots of nice time savers here. good work.
definitely want to cross post to the scp forum for some proper code review.
« Last Edit: February 12, 2011, 12:37:17 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline m!m

  • 211
Re: Function/Feature Requests
not quite sure i understand what objectFromScreenPos is supposed to do. if its supposed to find ships on the screen, that is something i would have done with a frustum cull and so that kinda saves some time (and maths).
That function should look for a object that is at screen position x, y,  just like the "target under reticle" hotkey does but for a specified screen position.

up till now i mostly aimed turrets by setting the orientation of the base and barrel models, then called fireWeapon(). trouble there was you had to somehow tell the script which turrets were single part, which where 2 part, and also i dont believe the base orientation is accessible from anywhere (u/fvec would have needed to be accessible, then used to compute a matrix), so you would essentially have to guess as to whether the turret was upper or lower, and turrets at angles were all but impossible.  being able to do it with one function call really speeds things up.
Currently I'm doing exactly like that but with that I can rotate the turret to impossible angles and the fireWeapon() thing doesn't fire from the firing point but from the center of the subsystem.
Maybe we need another type for firingpoints that provides information about the firing point. I also noticed that weapons that have the "cycle" flag set don't cycle firingpoints on the turret.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Function/Feature Requests
id say in a perfect world, you would be able to take a turret, throw any world vector at it, and it would attempt to track that vector to the best of its ability, with regardless to its rotation speed and available fire arcs. such a function would work without needing to be told what kind of turret it was.

fire turret has many issues. im not even sure if it can fire beam weapons, it can fire flak, but needs to be told the detonation distance. i dont know why it doesnt take firing points into consideration, though i kinda think it should. it should also try to calculate the flak range automatically if it hasn't been called with a custom flak range.

if youve ever used my cockpit mod, you can see i have a very elaborate way to deal with turrets. though for the most part i had to manually provide settings in the form of a custom table. the turret system is still in somewhat of an incomplete form, i had planned to make it capable of everything shown in my older demos, but kinda lost interest.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline m!m

  • 211
Re: Function/Feature Requests
I added some other functions to the lua subsystem interface:
  • Varaibles: Turret resets, TurretResetDelay, TurnRate quite obvious
  • Function: subsystem:rotateTurret(vector worldPos[, boolean reset]) Rotates the turret to face worldPos
Updated patch is attached.

[attachment deleted by ninja]

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Function/Feature Requests
Committed to trunk in rev 7010
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 Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Function/Feature Requests
i also got a patch of some minor bugfixes and a few more functions that have been sitting in my lua.cpp for the last few months. for example:

-io.updateTrackIR() now returns false on failure (such as if there is no trackir available on the system).
-added descriptions for model.MomentOfInertia and model.radius
-added Physics.isGliding(), tells script if gliding is being used or not
-added Physics.LastPosition and Physics.LastOrientation, which should be useful on physics related scripts




[attachment deleted by ninja]
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline m!m

  • 211
Re: Function/Feature Requests
I tweak subsystem:fireWeapon() so now it actually fires the weapon from the correct firing-point.
I mostly copied the behavior from the existing function in aiturret.cpp so could a coder please check the attached patch?

Regards,
m!m

[attachment deleted by ninja]

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Function/Feature Requests
Committed to trunk in rev 7077, with slight adjustment to use model instances in order to get around the slowness known as ship_model_start()
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 The E :)

I have another patch (attached) that gives access to particle information but I needed to change some lines in particle.cpp/.h and I need some feedback if that is the right way to do it.

Regards,
m!m

[attachment deleted by ninja]

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Function/Feature Requests
and get mine too while youre at it.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: Function/Feature Requests
Both are in as of rev 7079
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 Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Function/Feature Requests
thanks.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline m!m

  • 211
Re: Function/Feature Requests
I need help with my particle code. The current code just isn't usable so I changed it to use the heap memory to obtain pointers on the objects (see attached patch). It mostly works but I can't get the isValid() method to work correctly as the pointer in the class is never set to NULL unlike the pointer in the vector. I can even see that the object was deleted as accessing the object later via lua simply results in garbage. I'm quite sure that I miss something obvious as I'm not very experienced in C++.
Thanks for you help,
m!m


<solved>
« Last Edit: March 30, 2011, 01:01:41 pm by m!m »