Author Topic: Lining up the requests  (Read 10062 times)

0 Members and 1 Guest are viewing this topic.

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Lining up the requests
i want to create huds from scratch, but there are a few problems with overriding the hud. for example not being able to target anything or aquire aspect lock. meaning if we want a new hud we must also script in new targeting from scratch.
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 WMCoolmon

  • Purveyor of space crack
  • Moderator
  • 213
Re: Lining up the requests
You should be able to target stuff with the normal keys, and use the .Target variable for the ship to set the targetting computer variables. Now that won't work for subsystems, I forget what evil plans I had in mind for that variable. I think the problem was that it would require checking that when the variable (TargetSubsystem) was changed, you'd have to change the Target variable as well, and I was skeptical of doing that.

As far as aspect lock, that is an icky problem. I hate how FS has it hacked in for the player ship, it's all messy and is completely incompatible with the way the AI does it. (Which is basically a time variable that changes depending on difficulty and show on. If the AI stares at your ass within a certain cone of vision for that long, it has a lock.) The easiest way to do that would be to extrude those variables into scripting (sigh) though I may come up with alternate solutions.

Really I need to finish the core scripting system. Right now I have a suspicious memory of variables (any of them) not being settable, and me not being sure quite why. Also, I was having a nice null CTD that I suspect is due to some stupid Lua thing. The internal Lua API/SDK has about as good debugging skillz as the original scripting system implementation, except all the variables are a whole lot vaguer. Generally, all I'll be getting is that some two-letter variable doesn't work with a three-letter variable, when using a function named _getN() or something similar.

The go-between interface for FS2 that I wrote, of course, never crashes and always has completely clear error messages. (Actually, some parts of it are downright paranoid.)
-C

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: Lining up the requests
ive had some problems with the new setup. get alot of errorless ctds every time i do something lua doesnt like. i usually run the game after every line of code to make sure i didnt screw something up majorly. really i think im gonna need to see some examples in order to move on. enough has changed where i dont really know what im doing anymore.
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 WMCoolmon

  • Purveyor of space crack
  • Moderator
  • 213
Re: Lining up the requests
Lua should never, ever do an errorless CTD. Can you post some example code?
-C

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
i know what i did, i used a ' instead of a , when using ba.createVector(). its just one of those wierd things. should at least give a syntax error.

btw what is the proper way to ger a component ov a vector, i tried 20 different ways and got 20 different errors.
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 WMCoolmon

  • Purveyor of space crack
  • Moderator
  • 213
This works for me:
Code: [Select]
#Conditional Hooks
$State: GS_STATE_INITIAL_PLAYER_SELECT
$On Frame: [
gr.setColor(255, 255, 255, 255)
gr.drawString(ba.createVector(1.0, 23.0, 3.0).y, 10, 60)
]
#End

Some of that will be different depending on the build, but the basic code there would be
Code: [Select]
ba.createVector(1.0, 23.0, 3.0).y
I know there was a problem with variables not getting set in newer builds, that has been fixed in the newest builds (see the other build in this recent builds forum).

I've also setup FS2_Open to pass along the Lua parsing error, as it wasn't before and that was causing the syntax error thing.
-C

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
im also having trouble getting physics handles from alpha one. i came to the conclusion that trying to get a handle from a handle doesnt work, the other scripters clued me in that i need to get a handle from an object and that they have no idea how to do this. all the scripters are scratching their heads with this one, so any assistance you can render would be apricieated :D were not sure if this is a bug or just something were not doing right.
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 WMCoolmon

  • Purveyor of space crack
  • Moderator
  • 213
Are you using the newer build, are vectors working, and can you post some sample scripting?
-C

 

Offline WMCoolmon

  • Purveyor of space crack
  • Moderator
  • 213
This:
Code: [Select]
#Global Hooks
$HUD: [
gr.setColor(0, 255, 0, 255)
gr.drawString("Player target's afterburner speed: " .. sv.Player.Target.Physics.AfterburnerVelocityMax.z, 10, 10)
]

should work in the Pre-Halloween build. I just tested it in my local codebase, and AFAIK none of the relevant code has been updated between builds.

In addition, I've updated the scripting.html to include signs of derivation. For example, the "ship" section is now listed as "ship:object" as it is derived from the object handle and should include all variables/functions of object.

There is a problem with the physics.MaxVelocity variable, as it looks like I moved it over from the object handle but forgot to update it accordingly. So you'll get errors complaining about 'type object expected'. Fixed that in my local codebase too.
-C

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
that helps alot, il see if i cant make something that works for a change :D

and vectors seem to work, just a matter od me not knowing how to use them right :D
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

 
Sweet!!!!

Set speed to zero, lifetime to something like 99999

Now all I need is to have the debris give off explosion effects and explosion sounds and it will be possible to do WC Prophecy style cap ship deaths.  :) :)
That's cool and ....disturbing at the same time o_o  - Vasudan Admiral

"Don't play games with me. You just killed someone I like, that is not a safe place to stand. I'm the Doctor. And you're in the biggest library in the universe. Look me up."

"Quick everyone out of the universe now!"