Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Jyin

Pages: [1] 2 3
1
Modding / Re: [MOD] Minister version 1.0b4
« on: January 08, 2013, 08:40:45 PM »
I just realized I was sitting on b5 code and forgot to post it.
I haven't really been active in SR, but it should work fine with 1.2.
I will add it in the 1st post.

2
Galactic Armory / Re: Exploration Discussion
« on: August 21, 2012, 09:15:43 AM »
How about deep space telemetry array?
If the system is big enough, you can get info from near by system.
Build bigger/better/more to extend the range.

3
This is a guess....
Your setting is set to make farm if food storage is 60% or lower.
But build_queue affects a planet, and anything over 50% of stock will get exported to bank in the planets assuming you got trade enabled.
Try setting the threshold much lower (like 10%).

4
Modding / Re: [MOD] Minister version 1.0b4
« on: August 10, 2012, 03:27:31 AM »
May I know which are the relevant bits of code?

Sure, anything in the "Game Data/gui" folder is for GUI.
But, some code are more complex than others. If you want to know how I've done things specifically, let me know I can point stuff out.
Some GUI code ties deeply into server code too.

5
Modding / Re: [MOD] Minister version 1.0b4
« on: August 09, 2012, 06:49:33 PM »
What GUI changes have you made? Can you please compile them into one post for easy ref? 'cause your ideas sound promising, but I don't want to mess up the interface, I like it as it is.

Just the GUI changes?
Not a lot, let's see.

When importing a carrier with default fighter, the Minister will look for the fighter. If it is not found, he will try to import the fighter first, then the carrier.
Moved the 'Delete' button on loading construction queues, I kept hitting that instead of 'Ok'.
Mouse over the system window and you get tool-tip.
Sub-system accordion is MUCH faster for those of us that like large design window.
Science Minister will turn on Auto-Research by default, and set the first technology to General Science.
He will also allow save/loading for research queues.
The research queue can contain un-locked technology, when he encounters these, he will try to unlock it.
He will hide away those embrassing default ship designs, and import all he can from his own stash, if he has any.
You will no longer get nice line pointing to the rally point. It's a side-effect of new Rallying system.

The b5 will have bit more changes too. Mostly related to research.

6
Star Ruler Discussion / Re: Some newbie questions
« on: August 08, 2012, 07:47:54 PM »
Yes refresh will make it factory (so to speak) default.
I know wiki is accessible from the BMS's home page. I don't use them often, so I can't say if they are any good.

7
Star Ruler Discussion / Re: Some newbie questions
« on: August 08, 2012, 03:37:14 PM »
#1, Auto update (or manual update) only affect blue print, not existing ships.
  If you make ship auto retrofit it will do so the 1st opportunity. Not something you want them doing just before the invasion, all at once.

#2, Yes
#3, Yes
#4, Docking place your ship inside of another object (ship, planets, stations).
I use auto-dock for fighter/carrier operation, as well as civilian ship to hide during invasion.

8
Suggestions / Re: Bind export to current tech levels
« on: August 08, 2012, 12:49:58 AM »
I like the idea.
I will see what I can do about that for my mod, I should be able to do this with b5 release.

9
Suggestions / Re: Warp Points
« on: August 08, 2012, 12:46:56 AM »
I don't agree.
One of THE best feature about SR is, go-anywhere galaxy.
You can even have fleet meet in deep space.
I hate those warp-high-ways.

With that said.
It's easy enough to create a sub-system called "Warp Gate" and make objects that do not have Jump Drive to warp to other system (or arbitrarily point in space). In fact the standard game already have this, just not for building by player. Or you can modify the current Jump Drive to be able to target an object (with sub-system, mass, etc as restrictions).

It is *FRUSTRATING* to see ships with automation that does not use Jump Drive, but even that can be address with mods (See my Minister Mod as example, one of main reason I wrote it was to make Jump Drive more useful).

10
Help & Support / Re: Why won't Star Ruler export blueprints?
« on: August 06, 2012, 03:45:31 PM »
Anything in the log? It might be helpful to run SR in verbose mode and post the log.

11
Scripting / Re: Crash in handling empire stats and research web
« on: August 06, 2012, 01:20:41 AM »
Azalrion is correct, web.getItem() can return null, even if the name of tech is correct, when it is still locked.
Also, it is generally good idea to use the access method, rather than direct reference.

so I would go with:
if( web.getItem(str_XXX) !is null )
   emp.setStat( str_XXX, web.getItem(str_XXX).get_level() )

12
Star Ruler Discussion / Re: Achievement Ideas
« on: August 03, 2012, 02:40:18 AM »
Here's few from our favorites.

Space the Final Frontier.
  - Send out colony ship blindly 100 times while 5 or more hostiles are present (Remnants too).

Please state the nature of...
  - Repair more than 1-triion HP in one game.

It's only a hobby.
  - Play SR for 1000 hours or more (total).

That's no moon!
  - Build space station of size 10000 or larger, and equip it with DSM.

I sense disturbance....
  - Use a space station to destroy the plant it's orbiting.

One in a million.
  - Kill a space station of significant size with one shot.

The wheel turns, does it not?
  - Defeat an opponent after loosing the home-world.

Sigma 957
  - Occupy Remnant Imperial Seats and Gate system.

I think you are about to go where everyone has gone before.
  - Loose a game.

13
Modding / Re: [MOD] Minister version 1.0b3
« on: August 03, 2012, 01:32:19 AM »
I am about to wrap up b4.
The b4 has a lot of new features. Here's what I have in change log.
It's a complete list for b4, I just need to make sure I didn't break anything.

Code: [Select]
1.0b4
Expansion Minister will check the food/lux supply before building farm/lux world.
She will send out ColonyShips to under defended system if she knows there is no piracy in the universe.
Removed Shipyard and Cargo in Farm/Research/Lux world.
If you do not build Haulers, trying to build anything in these world will be very slow.
Removed Space Port from Lux/Research.
Note, if you use Colonizer with 3 or more slots, ports are built by initial landing.
Minister will remove these ports at very last step.
Fixed build_queue to have Minister take over just after building Capitals.
Defense Minister will no longer retrofit the only Military Outpost in the system.
He will build a new one before taking down the old one.
Military Minister now have control over rallying of ships
Rallying ships now use Jump Drive, if they has one.
Rally now only affect war-ships (ships with both weapons and engines).
Rallying can be set at site and/or system level.
The site rally point will take priority over system rally point.
When entering a system, war-ships will check the systen rally point, and move on, if they are not needed.
This is also true for the system where the war-ships are built.
This behavior will effectivly create patrol path of war-ships.
You will no longer get nice line pointing to the rally point. It's a side-effect of new Rallying system.
Governors have been sent to re-education camp. They can now count the population of planet correctly.
They will now upgrade both Galactic Capital and Planetary Capitals.
Science Minister will turn on Auto-Research by default, and set the first technology to General Science.
He will also allow save/loading for research queues.
The research queue can contain un-locked technology, when he encounters these, he will try to unlock it.
He will hide away those embrassing default ship designs, and import all he can from his own stash, if he has any.
Default Minister Settings are now configurable in Settings.txt. It also have some settings that are not in GUI.


I am getting pretty close to full feature set that I envisioned when I started this.
I think b5 will be the last version to add new feature, and will become 1.0rc1 once most of bugs are stumped out.
I will be enhancing the new Science Minister in b5, make him adaptable.
It's a pretty big item, so I wanted to get b4 out before I start on that.
The new Science Minister will be the only new feature of b5, unless something change.

If you have any request of features that I didn't add yet, now would be the time  :)

14
Scripting / Drawing in 3D
« on: August 01, 2012, 12:44:04 PM »
Another question.
Can a mod draw in the 3D space?
I would like to draw a simple line from one object to another (in specific color, of course).

15
Scripting / Re: The getStateVals is giving me a headache, someone help?
« on: August 01, 2012, 11:45:01 AM »
Going to have to go about this whole differently.
Oh well.

16
Scripting / Re: The getStateVals is giving me a headache, someone help?
« on: August 01, 2012, 11:22:38 AM »
Ah, so the State isn't empire/player specific.
That's what I was missing.

So, how do I save custom data is tied to system/star that is empire/player specific?

17
Scripting / Re: The getStateVals is giving me a headache, someone help?
« on: August 01, 2012, 11:00:50 AM »
Just to be sure, I repeated the test with standard game code.
It does the same thing.

18
Scripting / Re: The getStateVals is giving me a headache, someone help?
« on: August 01, 2012, 10:49:58 AM »
Actually on client, you should *always* check the return value, just in case.

Here's what I found out.

I ripped out all the related code from both server/client side.
I dropped this code in the triggerContextMenu() in context_menu.as
I left the resources.xml alone, so the setting is in there still.

Code: [Select]
// TEST CODE
print( "Testing getStateVals() on " + selObj.getName() + " uid = " + selObj.uid );
float tmp1 = 0.f, tmp2 = 0.f, tmp3 = 0.f, tmp4 = 0.f;
selObj.getStateVals(strRallyToObject, tmp1, tmp2, tmp3, tmp4);
print( "previouse tmp = " + tmp1 + ", " + tmp2 + ", " + tmp3 + ", " + tmp4 );

tmp1++; tmp2++; tmp3++; tmp4++;
print( "input tmp = " + tmp1 + ", " + tmp2 + ", " + tmp3 + ", " + tmp4 );
selObj.setStateVals(strRallyToObject, tmp1, tmp2, tmp3, tmp4);

tmp1 = 0.f; tmp2 = 0.f; tmp3 = 0.f; tmp4 = 0.f;
selObj.getStateVals(strRallyToObject, tmp1, tmp2, tmp3, tmp4);
print( "output tmp = " + tmp1 + ", " + tmp2 + ", " + tmp3 + ", " + tmp4 );
// END TEST CODE
Here's the interesting part.

Code: [Select]
Testing getStateVals() on Zerz IV uid = 3778
previouse tmp = 0, 0, 0, 0
input tmp = 1, 1, 1, 1
output tmp = 1, 1, 1, 1
Testing getStateVals() on Zerz IV uid = 3778
previouse tmp = 1, 1, 1, 1
input tmp = 2, 2, 2, 2
output tmp = 2, 2, 2, 2
Testing getStateVals() on Zerz IV uid = 3778
previouse tmp = 2, 2, 2, 2
input tmp = 3, 3, 3, 3
output tmp = 3, 3, 3, 3

As you can see, works perfectly for planets, even if the State was never allocated on server side.

Code: [Select]
Testing getStateVals() on Zerz Star uid = 1189
previouse tmp = 0, 0, 0, 0
input tmp = 1, 1, 1, 1
output tmp = 0, 0, 0, 0
Testing getStateVals() on Zerz Star uid = 1189
previouse tmp = 0, 0, 0, 0
input tmp = 1, 1, 1, 1
output tmp = 0, 0, 0, 0
Testing getStateVals() on Zerz Star uid = 1189
previouse tmp = 0, 0, 0, 0
input tmp = 1, 1, 1, 1
output tmp = 0, 0, 0, 0

Now the problem starts, when I target @Star. Notice the output does not match the input.

Code: [Select]
Testing getStateVals() on Zerz uid = 1188
previouse tmp = 0, 0, 0, 0
input tmp = 1, 1, 1, 1
output tmp = 0, 0, 0, 0
Testing getStateVals() on Zerz uid = 1188
previouse tmp = 0, 0, 0, 0
input tmp = 1, 1, 1, 1
output tmp = 0, 0, 0, 0
Testing getStateVals() on Zerz uid = 1188
previouse tmp = 0, 0, 0, 0
input tmp = 1, 1, 1, 1
output tmp = 0, 0, 0, 0

And of course, doesn't work with @System either.
I am start to think this is a bug.

19
Modding / Re: Modding Capitals to be 'not' useless.
« on: August 01, 2012, 10:27:21 AM »
Ah i see.

20
Scripting / Re: The getStateVals is giving me a headache, someone help?
« on: August 01, 2012, 10:11:54 AM »
This is true, you need <isSetting/> to modify from the client.

This is false. If a state is marked as a setting, the client will be able to allocate it.

Humm.. I tried that, and I keep getting getStateVals() to return false when I didn't call getState() in the server beforehand.

21
Modding / Re: Modding Capitals to be 'not' useless.
« on: August 01, 2012, 10:07:42 AM »
Slightly different choices in my own mod. But with the sr 1.2.1 update you should notice that capitols (any unique building) are able to be properly renovated now. GGL fixed the problem that prevented that in 1.2.0 and earlier

Humm... I don't think that's the case for 1.2.1.0.
Here's what I see in structures.txt
Code: [Select]
System: Capital
Name: #SS_CAPITAL_NAME
Description: #SS_CAPITAL_DESC

Available: true
Level: 1
Size: Scale
Durability: 2000 * Size
Mass: 400 * Size

Tags: Structure, Unique, Capitol, Unique:Capitol

Costs: Labr[BLDG_LABR_MULT * 100 * Size]
Complexity: 1

vHousing: Size * 600000

Provides: Housing with
Amount[vHousing]

Provides: FoodStorage with Amount[500]

Provides: MetalStorage with
Amount[Size * 250]

Provides: ElecStorage with
Amount[Size * 100]

Provides: AdvPartsStorage with
Amount[Size * 50]

Provides: MakeFood with
Rate[Size * 0.1]

Provides: Repair with Rate[Durability / 120]

Provides: LaborPool with Amount[Size * 0.1]

Provides: PopEconomy

Provides: DamageResistance with Amount[pow(LEVEL_GAIN_CURVE, Level) * 1.25 * Size]

Provides: Trade with
Rate[Size * 3]

Hints: Housing[vHousing], TradeRate[Size * 3]


System: GalacticCapital
Name: #SS_GLXCAPITAL_NAME
Description: #SS_GLXCAPITAL_DESC

Available: true
Level: 1
Size: Scale
Durability: 20000 * Size
Mass: 400 * Size

Tags: Structure, Unique, NoManualBuild, Capitol, Unique:Capitol

Costs: Labr[BLDG_LABR_MULT * 400 * Size]
Complexity: 1

vHousing: Size * 2400000

Provides: Housing with
Amount[vHousing]

Provides: FoodStorage with Amount[2000]

Provides: MetalStorage with
Amount[Size * 2500]

Provides: ElecStorage with
Amount[Size * 1000]

Provides: AdvPartsStorage with
Amount[Size * 500]

Provides: Repair with Rate[Durability / 12]

Provides: LaborPool with Amount[Size * 1]

Provides: PopEconomy

Provides: DamageResistance with Amount[pow(LEVEL_GAIN_CURVE, Level) * 2.5 * Size]

//Free (but slow) generation of key resources
Provides: CapitalSupport with Metals[Size * 50], Electronics[Size * 25], AdvParts[Size * 10], Food[Size * 1]

Hints: Housing[vHousing], MtlGen[Size * 50], ElecGen[Size * 25], AdvGen[Size * 10], FoodGen[Size * 1]


22
Modding / Re: Carrier building question
« on: August 01, 2012, 10:03:03 AM »
Just make sure your 'solar system sized' battle cruiser is named Gurren Lagann and you're set

Hehe, I am old-school. I name those Gun Buseter.

23
Scripting / Re: The getStateVals is giving me a headache, someone help?
« on: August 01, 2012, 09:37:42 AM »
If it returns false as far as I know it only means its not YET assigned values. I use a few states in tweaks of my own and I never check the return value of that. I just make sure my stringname is unique and assign a value as needed. I've also never used an entry in resource.xml

Basically the state is allocated the first time you 'set' values. This is how std::maps work at least and it was my assumption thats how states are implimented

That's how *server* side works, I believe.
On the *client* side, I don't think you can allocate State that isn't already allocated by server.
Thus, it's important to check the return value of get before you set.
The resources.xml allows the client to access server's State. If you don't set that, get will never return true.

24
Scripting / Re: The getStateVals is giving me a headache, someone help?
« on: August 01, 2012, 09:25:11 AM »
from.getStateVals( ... )

Why do you bother checking the return value of this? The return value (a bool) is only gonna state whether a value had already been assigned. The only thing you should be worried about is the  val1 - val4 values. Check them for what state you want them to have.  It seems to me your client code is working fine, its the server code not ever SETTING any initial values for your new state on ships that is being overlooked.

Also I havent messed with resources too much, only states. Why do you create a resource entry and what affect does this have?

-edit- for clarification

The thing is, the State may or may not be allocated.
If they are not allocated, getStateVals will return false.
If it return false, it's my understanding that, you can't assign new values.

On the server side, you can use getState to allocate State.

25
Scripting / Re: The getStateVals is giving me a headache, someone help?
« on: August 01, 2012, 09:22:07 AM »
Object@ sys_obj = sys;

Does angelscript allow the auto cast there?  Wouldnt you need

Object@ sys_obj = sys.toObject();

?

Holly crap, I didn't see that.
That might be what's causing the issues.

Although compiler didn't give me any grief, and the getName() actually return correct value later in the same code.
I know you can do it other way around (from Object@ to System@).

26
Scripting / The getStateVals is giving me a headache, someone help?
« on: August 01, 2012, 03:01:57 AM »
So. I need to save a reference to an Object, to another Object.
I can use getStateVals to save an uid of the target object to the source object.
This works..... to a point.

When the source object is a planet, it works beautifully.
When the source object is a system, however, as soon as I try to retrieve the value in client, getStateVals returns false.
Works fine in the server code, it seems.

I have added isSetting to the resources.xml.
I have called (in the server) getState() just to make sure the state is allocated.

I am at loss here.
Here's the part of the code that set up the State, running on server side.

Code: [Select]
const string@ strRallyToObject = "CustomRallyPoint";

Code: [Select]
uint cnt = getSystemCount();
int numPlanets = -1;
for (uint i = 0; i < cnt; ++i) {
System@ sys = getSystem(i);
Object@ sys_obj = sys;
if (@sys == null)
continue;

uint UID = 0;
State@ s = sys_obj.getState( strRallyToObject );
float tmp1 = 0.f, tmp2 = 0.f, tmp3 = 0.f, tmp4 = 0.f;
if(!sys.isVisibleTo(emp)) {
SysObjList objects;
objects.prepare(sys);

// Set up custom Rally Point for system
float tmp = 0;
if( sys_obj.getStateVals(strRallyToObject, tmp1, tmp2, tmp3, tmp4) ){
sys_obj.setStateVals(strRallyToObject, 0.f, 0.f, 0.f, 0.f);
if(log) print( "Resetting Rally Point for " + sys_obj.getName() + " uid = " + sys_obj.uid );
}
else
if(log) print( "Failed resetting Rally Point for " + sys_obj.getName() + " uid = " + sys_obj.uid );

objects.prepare(null);
}
}


As you can see, it outputs verification with uid.
Code: [Select]
Resetting Rally Point for Haol uid = 1058
Resetting Rally Point for Vilo uid = 1110
Resetting Rally Point for Uza uid = 1188
Resetting Rally Point for Daol uid = 1196
Resetting Rally Point for Derm uid = 1202

Here's the set up in the resources.xml
Code: [Select]
<resource name="CustomRallyPoint">
<isSetting/>
</resource>

Now here's the client code that reads this value.
The client code is executed as a response to context menu, inside of addGalacticCommands()

Code: [Select]
Object@ rally = null;
Object@ obj = sysFrom.toObject();
float tmp1 = 0.f, tmp2 = 0.f, tmp3 = 0.f, tmp4 = 0.f;
print( "Getting Rally Point for " + obj.getName() + " uid = " + obj.uid );
if( obj.getStateVals(strRallyToObject, tmp1, tmp2, tmp3, tmp4) ) {
uint UID = uint(tmp1);
print( "tmp = " + tmp1 + ", " + tmp2 + ", " + tmp3 + ", " + tmp4 );
print( "Get Rally point = " + UID );
if( UID != 0 ){
@rally = getObjectByID(UID);
}
}
else
print( "Failed getting Rally Point for " + obj.getName() + " uid = " + obj.uid );

And this is what I get:
Code: [Select]
Getting Rally Point for Uza uid = 1188
Failed getting Rally Point for Uza uid = 1188

Now I have almost identical code in addGeneralOrders()

Code: [Select]
Object@ rally = null;
float tmp1 = 0.f, tmp2 = 0.f, tmp3 = 0.f, tmp4 = 0.f;
print( "Getting Rally Point for " + from.getName() );
if( from.getStateVals(strRallyToObject, tmp1, tmp2, tmp3, tmp4) ) {
uint UID = uint(tmp1);
print( "tmp = " + tmp1 + ", " + tmp2 + ", " + tmp3 + ", " + tmp4 );
print( "Get Rally point = " + UID );
if( UID != 0 ){
@rally = getObjectByID(UID);
}
}
else
print( "Failed getting Rally Point for " + from.getName() );

And this one works fine, as long as the 'from' is a planet.
I really need to test it with Ships too.

27
Modding / Re: Carrier building question
« on: July 31, 2012, 10:33:17 PM »
We wouldnt get along to well in game. I do cpu only designs and name them after cylon stuff =-)

I steal names from everywhere :).
Those two just happen to be named that way because they are carriers.

My Escorts for those two are named Prometheus.
In later game, I have Super-Carrier names Macross as well.

28
Modding / Re: Modding Capitals to be 'not' useless.
« on: July 31, 2012, 10:28:27 PM »
Next version of Minister will have upgradable capitals.
G-Cap will act as if you have city/mine/elec/adv/farm all in one.
P-Cap will act as if you have city/port/farm all in one.
Both caps will be upgraded by Sociology.

I should be get it out of the door once I run it through the quick paces to stump out obvious bugs.

29
Modding / Re: Carrier building question
« on: July 30, 2012, 08:33:03 PM »
What I do is make 2 identical carriers and send them as pair.
I call one Galactica, and other Pegasus :).
Galactica carry flighters called Viper, and Pegasus carry bombers called Cobra.

30
Modding / Re: [MOD] Minister version 1.0b3
« on: July 29, 2012, 07:26:24 PM »
Defense Minister will make anything that is named "Military Outpost", just design it with standard hull and engines.
I am not about to change the 1-farm thing. I don't think I want to worry about building farm when blockaded.

Older version made the Military Outpost on every planet. That's what shipyard/cargo/port was for.
I am removing some of that in b4.

Point of Minister is not building removal, although it will do that in most cases.
The point of Minister is help the player, not replace one. For that, it does what it does less precise/efficient than you would.
Minister will not optimize, they will only correct gross mis-management. If you want tight control, Minister is not for you.

Pages: [1] 2 3