Station Assult & iFleet conflict?

More
17 years 3 months ago #16124 by GrandpaTrout
Have done any programming in any language?

Send a note to Soupdragon about the Unleashed file. See, your well on your way as a bug hunter.

Please Log in or Create an account to join the conversation.

More
17 years 3 months ago #16125 by Szappy

Originally posted by GrandpaTrout

Have done any programming in any language?

Send a note to Soupdragon about the Unleashed file. See, your well on your way as a bug hunter.

let's see... basic (on C=64 :p ) pascal, delphi, labview, toolbook...
It's been a long time since I did any coding tho. Making algoritms is still quite easy for me, but making them in a scpecific language is another matter. And as I see it, POG is closest to C, which I never programmed in...

Please Log in or Create an account to join the conversation.

More
17 years 3 months ago #16126 by GrandpaTrout
If you have run a compiler, that makes it much easier. Unpack the POG sdk. There is a help file. At the bottom of the list of help topics is "developing scripts".

Your first step is to get the compiler installed in the correct location. And then get a batch file setup for compiling a source file. Once you can recompile the source for station assault, you will be 90% of the way to making a fix. The developing scripts section describes how to do the setup.

I would get a good programmers editor. There is a free one that has been recommended - I don't remember the name. I will try to find it and send it along. You want something that has nice syntax highlighting and good automatic indention.

Please Log in or Create an account to join the conversation.

More
17 years 3 months ago #16143 by Szappy
OK, I set up the compiler, and recompiled the original station assault code.
It seems to be working, so on to fixing it. :)
The main problem is, that although I understand what the algoritm does, I don't have a clue what the variables store. In this case the
Code:
Object.IntProperty(current, "zz_rebuild_count" )
it seems to be zero, so the next line just increases it to 1, and in the next cycle it gets set to zero again...

As I'm at it, I also spotted an interesting code in unleashed "iUnleashedSystem.Initialize" called on each 'enterSystem'
It's as follows:
Code:
Initialize() { int number; int count; list habitats; hsim station; habitats = List.FromSet( iMapEntity.SystemHabitats() ); number = List.ItemCount( habitats ); for ( count = 0; count < number; ++count ) { station = iMapEntity.SimForEntity( iMapEntity.Cast( List.GetNth( habitats, count ) ) ); if ( iMapEntity.IsDestroyed( iMapEntity.Cast( station ) ) ) { iMapEntity.SetDestroyed( iMapEntity.Cast( station ), false ); if( iMapEntity.IsHidden( iMapEntity.Cast( station ) ) ) iMapEntity.SetHidden( iMapEntity.Cast( station ), false ); } if ( ( iHabitat.Type( iHabitat.Cast( station ) ) != HT_HoffersGap ) && ( iHabitat.Type( iHabitat.Cast( station ) ) != HT_HoffersHeel ) && ( iHabitat.Type( iHabitat.Cast( station ) ) != HT_PlayerBase ) ) iSim.SetIndestructable( iSim.Cast( station ), false ); } }
Now this code seemingly resurrects every single station in the system. This is probably a similar approach to station assault, as unleashed also makes stations vulnerable, and reduces their hitpoints. The programmer obviously chose another path to resurrect them though.
I simply commented this out of the unleashed_main.ini, because I want to let station assault handle the resurection.

The question is: Does this piece of code do anything other than resurrecting the bases?

[edit] any news of the programmers editor?

Szappy

Please Log in or Create an account to join the conversation.

More
17 years 3 months ago #16145 by GrandpaTrout
Here is one that was recommended on the board. I tried it, and it is nice. Looks like there are a bunch out there Google "programmers editor"

www.textpad.com/


I like the Unleashed version of the code better. The reason is that it rebuilds after a capsule jump (enter space is called when a player capsule jumps into a system). Which is nice, because that automatically puts time between blowing the station up, and a new station. Plus it means the player has left the station far behind.

The station assault code is adding one to a timer that is attached to the station. The object property functions attach variables to an object or use the ones that are already there. The property "hit_points" is a property that most objects already have.

I am guessing the problem is that property was not "added" before trying to be set. Change this line from:

Object.SetIntProperty( current, "zz_rebuild_count", rc );

To

Object.AddIntProperty( current, "zz_rebuild_count", rc );

You can add the same property many times, it just overwrites the old value. Which is what you want done any way. Now the code will slowly increase "zz_rebuild_count" until it is greater than 29, then it will put the station back.

There are no true global variables in POG and no structures. So you end up using objects with attached properties to store things. Which is just what Zazzicle did here.

The question is: Does this piece of code do anything other than resurrecting the bases?


Yes. It turns the station map visible, so that the player can see it on the map screen. Some bases are hidden by the plot line, but those will be revealed by this code.

Also, stations start out unable to be destroyed "Invulnerable" and the code allows stations to be destroyed Invulnerable set to false. Except the critical stations for the game, like the players base and hoffers gap.

Please Log in or Create an account to join the conversation.

More
17 years 2 months ago #16212 by Szappy
I'm back, with mixed results.
The good side is, that I'm learning the POS script language.

The bad is, that I'm unable to get it working right [:(]
I tried your suggestion of Add-ing the property, it didn't work. The results were the same, as with "Set".

I tried commenting out the whole
Code:
rc = Object.IntProperty( current, "zz_rebuild_count" );
row. It seemed working (not right, but at least the counter increased), but when it reached 30 it said "Rebuilding Station" but it did not rebuild it.
On top of that, if more than one station was destroyed, the counter increased once in every 60 seconds for each one. And it also restarted every time I launched from base (that is understandable, since the code that would store the counter's value does not work).

Now I'm wondering, is it even possible to attach properties to a destroyed entity? Couldn't it be the problem?

Szappy

Please Log in or Create an account to join the conversation.