Third Plea For Help

For discussion of ports to POSIX based systems, especially using GNUStep.

Moderators: winston, another_commander, Getafix

User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1385
Joined: Thu Apr 28, 2011 3:17 pm

Re: Third Plea For Help

Post by mandoman »

Eric Walch wrote:
mandoman wrote:
... but I can't get them to initialize. I took a look at the Aquatics setup, and changed a couple of minor things, such as putting "initializeTurret" in parenthesis, but nothing I do activates them in the game. I don't get it. I was able to manipulate them into the correct places using the "subentities" option, why doesn't the description of the ball turret not connect and initialize the turrets? Could you please help me just a little more on this? I feel so close to getting them working, but can't quite nail it. Any help would be fantastic. Thanks. :)
You use "ballturret" as keyname. But, that is an entity that is already defined by Oolite and there should be no reason to overwrite the internal files.

However, the big problem is that a lot of scripters like to overwrite the internal files for unknown reason. That means that only the last one will load. And if that last one is a bad copy of the original, all ballturrets in Oolite that are based on that copy are screwed.

As said before, I would use unique keys for the ships to make sure no other oxp will mess with your definitions.
That sounds more than reasonable, but when I tried doing that, the ballturrets on the ship vanished. I tried using a similar string that is used in Aquatics, by calling my particular set of turrets "Genesis_left/right/top/bottom-turret_subentity_key = 'ballturret'". I suck at writing script. There is something to it that I just can't seem to grasp.

Capt. Murphy, you say I should write my own unique scripts, but others have told me to wait on that, and use scripts from the core files as much as possible. That is why I use the core ball turret lines for defining the turrets on my ships. Those ball turrets are showing up on my ship, and I finally got them arranged so they were pointing outward, away from the ship itself, and I didn't have to use 1, 0, 0, 0 for any of them to make it happen. That suggests to me that they should have some rotation, even if it is just enough to see them twitch. As it is, they don't even twitch.

I'll keep working on it. I spent the last week just getting them to first appear on the ship, and then to all point outward away from the ship. Now I'll just have to keep manipulating the shipdata.plist until I get them to start tracking aggressors and firing.

Java Script sounds like a brilliant device for making things happen in the game, and so do unique AIs. The only thing, is it isn't simple to use. Maybe for those who have a lot of experience with computer script can adapt to Java Script without much problem, but I have no such background. My older brother, who is a programmer that took advanced calculus, and trigonometry didn't even recognize the word "Quaternion", when I asked if he had any experience with it. Of course, those advanced courses he took were when he was in college, about 40 years ago. If I ever get this Quaternion stuff figured out, I'm going to start writing a comprehensive guide for idiots, like me, who don't grasp such things so easily. Same goes for Java Script, if I ever figure it out.

It all sounds so easy from the way you guys talk, but it's only easy if you know what you're talking about. I was using Gimp, and Inkscape to make up all kinds of neat stuff before I learned of Blender. Now Blender is almost easy for me, and I can lose myself in it, manipulating the vertex points to come up with designs I could only imagine in my mind before. Then when I get it translated into .dat form, and see it in the game, it makes me all the more excited to build another, and another, etc......

That's about all I can do, though. I can make player useable ships all day long, especially if there aren't any tricky quaternion things on them. They die on the drawing board when it comes time to write script, and AIs for them, though, even though I know exactly how I would like them to behave. Oh well, enough said. Thanks to all for helping me get that aft laser problem figured. I still can't hardly believe that it came down to a missing letter "i". Sheesh! :roll:
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: Third Plea For Help

Post by Capt. Murphy »

Mandoman, don't give up on it. I knew diddly squat about JS before about 6 months ago and am not a regular programmer/scripter in any other language. When I was a youngster I did do a lot of stuff in BBC Basic.

Having said that I think my brain works in a way that facilitates me following the 'logic' behind programming as I did (several few years ago) manage to pick up enough x86 assembly language to make a number of mods to another game (Hardwar) by injecting code snippets into it's .exe on the fly during play. It's all long forgotten though.

What I can't do it get my head around blender or wings 3D so you are ahead of the game there. Modelling and texturing if not entirely a mystery will never be my strong-point I fear. Quaternions also make my head hurt.... :mrgreen:
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Third Plea For Help

Post by Eric Walch »

mandoman wrote:
My older brother, who is a programmer that took advanced calculus, and trigonometry didn't even recognize the word "Quaternion", when I asked if he had any experience with it. Of course, those advanced courses he took were when he was in college, about 40 years ago.
I don't think anybody is expecting that quaternions are understandable for all. I have an university background of chemical engineering. There I have had my part of heavy mathematics and vector math, but no quaternions. Quaternions are mainly interesting for gaming to do fast calculations with movement.
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8515
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Re: Third Plea For Help

Post by DaddyHoggy »

As Eric says - don't give up, my background is physics originally - and I didn't come across quaternions until I started building missile simulations - and quite a lot of that was cutting and pasting from papers that already existed and coding it up from there - and then lots of head scratching when it didn't quite work as planned (pulling up, rather than diving was a classic...)
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
Mauiby de Fug
---- E L I T E ----
---- E L I T E ----
Posts: 847
Joined: Tue Sep 07, 2010 2:23 pm

Re: Third Plea For Help

Post by Mauiby de Fug »

I join the crowd of people saying don't give up! I'm familiar enough with JavaScript, as that was how I could do some basic scripting in VRML when I was younger. (I ended up mostly using the VRML part as an interface for the actual programming that I wanted to do, so I'd create 3d "worlds" consisting of a few spheres used as start buttons for the real stuff I wanted to do.) But understanding AIs still eludes me. I can theoretically create models for ships (in that I had at one point a very basic understanding of how the program worked and could get it do do what I wanted) although I'm somewhat limited in my imagination there, but I wouldn't know where to begin when it comes texturing. So don't be too disheartened if you have trouble with some things!

As far as quaternions go, I first heard about them as an extension of the complex numbers, and I'm familiar enough with them from group theory and algebra, but didn't know before I found this board that they could be used for rotations. I'm used to using standard rotation matrices for those. But reading the wiki page they don't look too bad, in that I reckon I could probably get the hang of them if I ever needed to use them. In fact, I'm tempted to try and create something, just so I'd have a reason to see if I can actually use them!
User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1385
Joined: Thu Apr 28, 2011 3:17 pm

Re: Third Plea For Help

Post by mandoman »

Thanks for encouragement, guys. I'm not giving up. I get frustrated, a bit, but I actually enjoy trying to figure this stuff out. I'm hoping it'll keep my brain cells active enough to avoid total memory loss as I get older, LOL!!! :lol:

Capt. Murphy, I took your advice and created my own ball turret system. It's basically identical to the Oolite-ball-turret, but I've changed it a bit, and renamed it the Genesis-ball-turret. I now have a genesisballturret.dat, genesisballturret.png, a genesis_ball_turret.js, and a genesis_ball_turretAI.plist. I hope Thargoid doesn't mind that I borrowed from his Aquatics oxp a bit for the last two. I did all that, changed the shipdata.plist to reflect it, and the ball turrets look great........but I still can't get them to initialize. So what else is new, eh? :mrgreen:

Oh, and Daddy Hoggy, your avatar is sure seasonably festive. I love it. :D
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Third Plea For Help

Post by Thargoid »

If I minded you borrowing bits from it (subject to its license so you don't break it, which doesn't seem to be an issue here) I wouldn't have pointed you at it ;)
User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1385
Joined: Thu Apr 28, 2011 3:17 pm

Re: Third Plea For Help

Post by mandoman »

Thargoid wrote:
If I minded you borrowing bits from it (subject to its license so you don't break it, which doesn't seem to be an issue here) I wouldn't have pointed you at it ;)
Makes sense. Thanks. :D
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman
User avatar
RyanHoots
---- E L I T E ----
---- E L I T E ----
Posts: 958
Joined: Fri May 20, 2011 8:10 pm
Location: Nowhere
Contact:

Re: Third Plea For Help

Post by RyanHoots »

I'm having trouble with turrets, as well. As this picture shows, the turrets exist:

Image

Here's my .plist code for the turret, copied from Aquatics:

Code: Select all

"taki-cannon" =
	{
		ai_type = "nullAI.plist";
		accuracy = 5;
		laser_color = "greenColor";
		model = "taki-cannon.dat";
		name = "Taki Ball Turret";
		roles = "ballturret taki-cannon";
		setup_actions = ("initialiseTurret");
		max_flight_pitch = 1;
		max_flight_yaw = 1;
		max_flight_roll = 1;
		thrust = 1;
		weapon_energy = 25;
		weapon_range = 5;
		energy_recharge_rate = 2;
		max_energy = 200;
	};
The turrets don't fire at all. Here's the .plist code for the ship using the turrets, if it's helpful:

Code: Select all

"taki" =
	{
		aft_eject_position = "0.0 5.5 -17.0";
		laser_color = "greenColor";
		ai_type = "pirateAI.plist";
		auto_ai = yes;
		cargo_type = "CARGO_NOT_CARGO";
		energy_recharge_rate = 3;
		exhaust = ("0.0 0.0 -27.5 10.0 8.0 12.0");
		forward_weapon_type = "WEAPON_BEAM_LASER";
		hyperspace_motor = no;
		has_scoop = 0.95;
		has_shield_booster = 0.25;
		likely_cargo = 1;
		max_cargo = 4;
		max_energy = 540;
		max_flight_pitch = 1.0;
		max_flight_roll = 2.0;
		max_flight_speed = 420;
		missile_launch_position = "0.0 -3.5 3.5";
		missiles = 0;
		model = "taki-mainhull.dat";
		name = "Taki";
		roles = "pirate taki";
		scoop_position = "0.0 -2.0 -3";
		thrust = 32;
		weapon_position_aft = "0.0 -4.5 -27.5";
		weapon_position_forward = "0.0 0.0 27.5";
		weapon_position_port = "-16.5 -3.0 0.0";
		weapon_position_starboard = "16.5 -3.0 0.0";

"subentities" = (
                        {
				subentity_key = "taki-cannon";
				position = (-10.0, 0.36, 20.0);
				orientation = (1, 0, 0, 0);
			},

           		 {
                                subentity_key = "taki-cannon";
                                position = (10.0, 0.36, 20.0);
                                orientation = (1, 0, 0, 0);
                        }
            
                );
	};
Any ideas what I got wrong? Thanks in advance.
Image
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Third Plea For Help

Post by Svengali »

As you are already using the new form of subent declaration simply use the type specifier and delete the setup_actions. E.g.

Code: Select all

{
  type = "ball_turret";
  subentity_key = "taki-cannon";
  position = (-10.0, 0.36, 20.0);
  orientation = (1, 0, 0, 0);
}
User avatar
RyanHoots
---- E L I T E ----
---- E L I T E ----
Posts: 958
Joined: Fri May 20, 2011 8:10 pm
Location: Nowhere
Contact:

Re: Third Plea For Help

Post by RyanHoots »

Svengali wrote:
As you are already using the new form of subent declaration simply use the type specifier and delete the setup_actions. E.g.

Code: Select all

{
  type = "ball_turret";
  subentity_key = "taki-cannon";
  position = (-10.0, 0.36, 20.0);
  orientation = (1, 0, 0, 0);
}
That works, thanks. :D

I still don't really understand how it works, at least I know that it does. :)
Image
User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1385
Joined: Thu Apr 28, 2011 3:17 pm

Re: Third Plea For Help

Post by mandoman »

Svengali wrote:
As you are already using the new form of subent declaration simply use the type specifier and delete the setup_actions. E.g.

Code: Select all

{
  type = "ball_turret";
  subentity_key = "taki-cannon";
  position = (-10.0, 0.36, 20.0);
  orientation = (1, 0, 0, 0);
}
Let me get this straight, as I'm a bit slow, all I have to do for my ballturrets to work is to make the shipdata.plist entries for the turrets like the way shown above, get rid of the setup_actions, and they should kick into gear? Gotta try it. :D
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman
User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1385
Joined: Thu Apr 28, 2011 3:17 pm

Re: Third Plea For Help

Post by mandoman »

Ya know something, I'm tired of all this stuff working for others, but not for me. I must have a script curse on me, or something. Maybe I'm just a script idiot, I don't know. The version of the genesis RyanHoots sent to me will no longer work. Not only that, even though I can bring the Genesis up using the Debug Console, it doesn't accept any of my commands to manipulate the turrets. All I get is "Syntax Error", and something about missing something .operator. I admit it, I don't understand what the problem is. I just put into the console what it says on the HowTo page that deals with it. The same page that taught me to spawn a ship using the console. I made those changes you gave, Svengali, but I can't test the ship in a way that lets me see if it worked. :?
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman
User avatar
mandoman
---- E L I T E ----
---- E L I T E ----
Posts: 1385
Joined: Thu Apr 28, 2011 3:17 pm

Re: Third Plea For Help

Post by mandoman »

Okay, I take it back, I'm not cursed, or a script idiot, because when I took the Genesis out on a flight, I hunted down some pirates, and they attacke, of course, and before I could even fire my laser, the Genesis started hurling plasm bolts at the attackers from at least four of the ball turrets. The turrets took out one of the pirates alone, I got one with the laser, and the other (a SunBat) ran for it. I was floored. I didn't think quick enough to snap a screenshot, or to go to exterior view to see what was happening from the outside. I'm back to make another test run. This is a WHOLE lot more like it. Thank you, Svengali. :D
Mandotech Industries Wiki Page.

http://wiki.alioth.net/index.php/User:Mandoman
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Third Plea For Help

Post by Eric Walch »

RyanHoots wrote:
That works, thanks. :D

I still don't really understand how it works, at least I know that it does. :)
Internally does Oolite only use the new style declarations. On building the cache on startup, all old style definitions are translated to the new one. When one of the old style subs contains a 'setup_actions' with "initialiseTurret", that subentity is defined as turret in the new style. The new style definition no longer looks at the setup_actions to see if it is a turret because it has a specific key telling it is a turret.
On the second start, Oolite gets the already converted definitions from the cache.

When you have the choice, I would always use the new definitions as that allows different specifications for the different turrets. eg. energy or speed
Post Reply