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.


Topics - ninekorn

Pages: [1]
1
Bug reports / Too many Heap sections crash!
« on: December 26, 2017, 06:42:18 am »
Hi guys, I have no clue what happened as I left my private server and game opened for the night. When I woke up this morning I had a Void Expanse crash. I wonder if it's due to my market mod? It worries me a bit since I have cleaned the 17 scripts that make the buy section of the market mod and got rid of every uneeded functions and variables and arrays and also I've removed all hiddenInStationNPCs from the game to just spawn a series of 15 of them in the starting station to test the market mod. The market mod was running fast but it seems that there is something that lags the server periodically... I have no clue if it's my market mod. I have put a sharable link of my google drive for the too many heap sections crash report. When you guys have the time to look at it.

Thank you!
nine

https://drive.google.com/file/d/1TpPtSUbVqBcpWf1A_Gw1Gg8KEIrr69zq/view?usp=sharing

2
Hey,

So I have been working on my market mod for Void Expanse and the good news is I was able to fix the HUGE hang / lag when accessing the market. So right now there is no lag or anything and that is due to how I rewrote the script. Basically, instead of having the whole 2500 lines of code in the same script, I was able to cut out every pieces of it to make 17 different scripts for every different market sections and different weapon types. Every time a step is taken for instance choosing the system to access the market than BAM a new dialogue opens with a hiddenInStationNPC that basically starts from where the other NPC left off right at choosing the stations for the system that was chosen with the first NPC.... So what I have created is a chain of NPCs that just do EXACTLY what the first script did but because there were so much variables and topics in the first 2500 lines script it was hanging the whole server. With this new system it fixes this... But there are issues... Right now spawning 15 NPC hiddenInStation doesnt seem to cause a lag issue with Void Expanse even IF I spawn them in every stations of the whole server. In the future I might reduce the number to 1 market terminal in each station and just 1 station contains the other HiddenInStationNPCs. We will see. But right now I am unable to fix the right prices for the items for the sell or buying functions. I have found pieces of code in the Trading.js and also the Stations.js but it doesn't seem to work properly because I am not getting the right prices unless I am not using them correctly? Here are the functions that I have tried:

Code: [Select]
function CalculateBuyPriceOfCargo(args)
{
var min = 1;
var max = 1.05;
var trade_margin = -ship.GetFinalCacheValue(args, "trade_margin");

var stationInfo = station.GetBaseByID(systemBases);
var fact = relations.GetFactionDispositionToShip(stationInfo.faction, args);
var relation_coef = 0.2 * GetFactionRelationCoef(fact);

var coef = min - (trade_margin + relation_coef) * 0.05;
coef = Clamp(min, coef, max);
return coef;
}


function CalculateBuyPriceOfItemModifier(args) {
var min = 1;
var max = 1.25;
var trade_margin = -ship.GetFinalCacheValue(args, "trade_margin");
var stationInfo = station.GetBaseByID(systemBases);

var fact = relations.GetFactionDispositionToShip(stationInfo.faction, args);
var relation_coef = 0.1 * GetFactionRelationCoef(fact);
var coef = max - trade_margin - relation_coef;
coef = Clamp(min, coef, max);
return coef;
}



function CalculateSellPriceOfItemModifier(args, min, max)
{
var min = 0.4;
var max = 0.9;
var stationInfo = station.GetBaseByID(systemBases);
var fact = relations.GetFactionDispositionToShip(stationInfo.faction, args);

var trade_margin = -ship.GetFinalCacheValue(args, "trade_margin");

var relation_coef = 0.2 * GetFactionRelationCoef(fact);
var coef = min + trade_margin + relation_coef;
coef = Clamp(min, coef, max);
return coef;
}

function GetFactionRelationCoef(relation) {
relation = Clamp(-150.0, relation, 150.0);
return relation / 150.0;
}


function Clamp(min, current, max) {
if (current < min) {
return min;
}
if (current > max) {
return max;
}
return current;
}

I thought that the CalculateBuyPriceOfCargo function was going to work but it doesn't really give me the right price of the cargo. The thing is for all of those function I am just sending the player Ship Id for the "args".

Before the function was

Code: [Select]
var relation_coef = 0.1 * GetFactionRelationCoef(args.faction_relation);

and I replaced it with the following code because the args which was only the player ship ID didn't contain the faction_relation stuff... So I went in the Scripting API Wiki page and found the relations.getfactionDispositi ontoShip but it doesn't give the right price:

Code: [Select]
var stationInfo = station.GetBaseByID(systemBases);
var fact = relations.GetFactionDispositionToShip(stationInfo.faction, args);
var relation_coef = 0.1 * GetFactionRelationCoef(fact);

Do you guys have any ideas how I could go and fetch the real prices of the items/cargo that show on the market page? And that would be with buying and selling stuff. I know you guys must be busy with Cryofall but if you've got a couple minutes to look into this i'd really appreciate it. If I can I will try to release this mod before new years day!

Oh and just trying to fetch the price with:
Code: [Select]
var price = generator.GetItemPrice(item.xml_id);
doesn't really give the price that the market shows... It seems to be the default price before all other modifiers are applied for instance the player level and player relation to faction of the station and whatnot!

Thank you!
nine

3
Hi,

So im working on drone commands "utilities" like "go pickup containers that are near". But theres one big issue. Ive tried to find a function in the Scripting API that gives me access to all the objects tags in the system or all the objects in the system or all objects in scope but theres nothing like that in the Scripting API. So i've decided to search with Notepad++ all the scripts for any functions that started with "generator." and found generator.AreThereAnyObjects(sys_idNPC, direction.x, direction.y, 25, { except_ships: true}); and that turns out to give Boolean true or false. I thought at first it could be meaningless since i dont need booleans but more the ID of the Objects... So I went ahead and found out I just could do this function. It pretty much does the same as the original function but instead i limit the range to 1 unit and just use a ForLoop with 15 radius in +x -x +y -y to get me the exact position where there are objects. I thought that would solve my problem... Lol the thing is generator.AreThereAnyObjects() doesnt take into consideration containers... so im stuck.  It does give me the position of any other objects though except containers + even IF i had the containers position there doesnt seem to be a function that gives me the gameObjectID at coordx-coordy. so Id still be stuck. I can't get the containerID without the ObjectID and i cant get the ObjectID without a function to help me find those IDs. If generator.AreThereAnyObjects() would also consider containers and also returning the ID of the object it finds then bam we would have a function that does exactly ship.ScopeObjects that isnt in the Scripting API. helllpppp.

Code: [Select]
function goPickContainers()
{

var player_id = npc.GetTag(SHIP_ID, "ownerPlayerShipId");

var sys_idNPC = npc.GetCurrentSystemID(SHIP_ID);

var direction = ship.GetCoordinates(SHIP_ID);

for (var x = 0; x < 15; x++)
{
for (var y = 0; y < 15; y++)
{
var objectsID0 = generator.AreThereAnyObjects(sys_idNPC, direction.x+x, direction.y+y, 1, { except_ships: true});
var objectsID1 = generator.AreThereAnyObjects(sys_idNPC, direction.x-x, direction.y+y, 1, { except_ships: true});
var objectsID2 = generator.AreThereAnyObjects(sys_idNPC, direction.x+x, direction.y-y, 1, { except_ships: true});
var objectsID3 = generator.AreThereAnyObjects(sys_idNPC, direction.x-x, direction.y-y, 1, { except_ships: true});

if (objectsID0 == true)
{
npc.FaceCoord(SHIP_ID,direction.x+x,direction.y+y);
}
if (objectsID1 == true )
{
npc.FaceCoord(SHIP_ID,direction.x-x,direction.y+y);
}
if ( objectsID2 == true )
{
npc.FaceCoord(SHIP_ID,direction.x+x,direction.y-y);
}
if (objectsID3 == true)
{
npc.FaceCoord(SHIP_ID,direction.x-x,direction.y-y);
}
}
}
}




4
Help section / Trying to set a global variable without using(storage);
« on: August 02, 2017, 09:12:47 pm »
Hi,

Ive got this question about creating a global variable in VoidExpanse javascript. Again, its something super easy in Unity3d but im not sure i get it in VoidExpanse. For example i created this script called globalArrays.js to store global variables.

Code: [Select]
var globalSwitchForMining = false;


var globalArrays =
{
miningSwitch: function (args)
    {
globalSwitchForMining = args;
console.Print(globalSwitchForMining + "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
    },

isMiningSwitchOn: function ()
    {
console.Print(globalSwitchForMining + "?????????????????????????????????????????????????????????");
return globalSwitchForMining;
    },
};


Then from another script I use this:
Code: [Select]
globalArrays.miningSwitch(true);

if (globalArrays.isMiningSwitchOn() == true)
{
  console.Print("YOU TURNED THE SWITCH ON");
}
else
{
console.Print(" THE SWITCH IS STILL OFF");
}

And in my last script to verify the global Variable i just use:
Code: [Select]
if (globalArrays.isMiningSwitchOn() == false)
{
console.Print("isMiningSwitchOn == false");
}


if (globalArrays.isMiningSwitchOn() == true)
{
console.Print(" WHERE AM I STUCK");
goMineSomeAsteroids();
canFollowPlayer = false;
}

and bam. Houston we've got a problem. the global variable is always false from the third script. If i cant create my own global variables then ill go back to use the using(storage) to set global variables.

5
Help section / How to use ship.SetEquipmentCacheValue?
« on: August 01, 2017, 08:15:16 pm »
Hi,
This question is for my follower/drone mod. I want to be able to modify their damage output. If I add    IMCache.AddValue("projectile_damage_energy_weap ons_instancepercent", 1000); in the calculateShip.js script my follower/drones do a lot of damage. The thing is this parameter wasnt there to start off. I added it just to try it and it works. Now i'm wondering if i can have access to that parameter through another script with ship.SetEquipmentCacheValue?. I might be going the wrong way with this but also wanted to know: is there a list of parameters that we can assign to IMCache for weapons/items and can we have that list? This parameter "projectile_damage_energy_weap ons_instancepercent" is something i found in the skills in the .XML files. With this type of parameters I have a couple ideas on how to fake Equipment changes to my follower/drone mod.

Thank you for answering.
nine

Edit: Is there also in the Scripting API a way to "ship.getequipment" for the NPCs? and like "ship.setequipment". Im asking coz it would be way easier than having to generate thousands of XML files with my xml file generator program I created especially if NPCS are generated and geared with different weapons when they have more than 1 weapon slots. I would have 10 times more drones xml files than weapons xml files.

6
Hi,

The Scripting API doesnt seem to recognize items.RemoveItem not recognized as a function! I've also tried station.RemoveItem or generator.RemoveItem or game.RemoveItem but none seem to work. items.RemoveCargo won't work because im trying to remove items from the station shop container. This is for my galaxy market mod.

Thank you in advance.
nine

7
Mods / Upcoming unlimited weapons mod and also a Galaxy Market.
« on: July 26, 2017, 03:25:29 am »
Still in the works of course just like the drone mod and follower mod. Ive still got to balance everything for the weapons and Im only done doing the basics of the Energy weapons for the moment.

https://www.youtube.com/watch?v=DKeEzVCNRTc

8
Modding info / Scripting API issue missing a function?
« on: July 19, 2017, 01:29:35 am »
Hi. just this little detail before I go sleep.

GetStationShopContainerId() is not working. is there another solution? i need the shop containers.

nine

9
Modding info / Getting the name of Systems?
« on: July 18, 2017, 11:05:25 pm »
Hi,

How can I get the name of a system. While they are generated with "var id = generator.AddSystem(0, 0, "SystemName", 123)" they dont seem to be tags so is there a function in the API that is available for us to use?

Ive searched the Wiki API and couldnt find anything.

Thank you.
nine

10
Mods / Drone Mod for VoidExpanse!
« on: July 16, 2017, 01:30:26 am »
Title: SC-Drone
Image: coming soon.
Author(s): ninekorn
Description: drones
Current Mod version: Beta V0.1
Game version: latest
Game mode: all
Versions:

V0.1: D├ętails coming soon!
https://www.youtube.com/watch?v=T-zxofNWXek


11
Mods / Drone/Follower mod // in-progress
« on: July 10, 2017, 10:02:55 pm »
Title: SC-Drones
Image: coming soon.
Author(s): ninekorn
Description: drones
Current Mod version: Beta V0.2
Game version: latest
Game mode: all
Versions:




V0.1: https://youtu.be/J7g7dVo-hCk

  • The Drones/follower are only following the owner/player. They have no other decisions
Date completed: 2017-07-10


V0.2: https://youtu.be/Nu06sZGVmpc


Current completed behavior:
  • The Drones/follower are following the owner/player to get close to a certain distance of the owner/player
  • The Drones/follower are also chasing after their owner/player if the owner/player gets away of a certain distance
  • The Drones/follower are also now attacking pirates when the pirates are at a certain distance from the drones/follower
  • The Drones/follower are also now unlocking from their targets (pirates) if the owner/player gets too far away from them and instead are deciding to chase the owner/player
  • The Drones/follower are also now NOT attacking Miners-Turret-Merchant at will. will try to implement more features here so that if they get attacked by those that they engage and if the player decides to attack those Miner-Turret-Merchant that they also attack them

Objectives to complete:

  • The Drones/follower need to be able to dock Inside the owner/ship and also undock at the press of a button.
  • ***Completed***The Follower need to be able to "dock" or be instantly docked Inside the player when the player docks at a station.***Completed*** The Follower Docks on station when the player is docked on station. Otherwise it follows normal routine.
  • ***Completed***The Drones/follower need to be able to also jump from Jumpgates to follow player if they are undocked from the player.***Completed***
  • ***other important behavior implementations***

Date completed: 2017-07-11

12
Modding info / Trying to make a Drone Mod?! Error in script...
« on: July 10, 2017, 04:34:19 pm »
Neither of my container spawning lines work (containerid  or cont_id)... They give me an error in the console when i try to use my device? If anybody knows what im doing wrong id really love to know. Thanks for the help in advance. I try to spawn a container to test the NPC behavior after that on the crate. I also try to spawn them away from the player ship so that no collision occurs.

nine


function OnStart(args)
{
   var shipID = args.ship_id;
   var name = game.GetShipOwner(shipID);
   var sysID = args.sys_id;
   var coords = ship.GetCoordinates(shipID);

   var item_list = "droplist_empty";

   //var containerid = generator.AddContainer(sysID,coords.x+5,coords.y+5,"crate_02",item_list);
    var cont_id = generator.AddContainer(sysID, coords.x+5,coords.y+5,"crate_02", item_list, { itemlist: item_list });

   //console.Print(shipID);
   //console.Print(name);
   //console.Print(coords.x);
   //console.Print(coords.y);
}





EDIT: I found my mistake. !  ;D


13
Mods / Adding Scripts from .xml notepad mods?
« on: July 09, 2017, 10:12:41 pm »
Hi!
I wanted to know if its possible to link a script Inside a .xml file found in the weapons folder of data directly to a script? for example:

<data>
       <script>

       </script>
</data>

14
Mods / Bigger galaxy Map mod?
« on: July 09, 2017, 07:49:45 pm »
Hi!

Im wondering if anyone has tried to get a bigger Galaxy map as in i can get 725 stars Inside one full map when i press "N". The map is squared and all my stars are covering the galaxy. What i am wondering is if it is possible to scroll more than the maximum amount allowed from left to right and bottom to top when we press "N". There seems to be that maximum scrolling that doesn't budge? Does anyone know which script needs modifying. I could try to modify but just don't know where i can find it.

Thank you in advance.
Ninekorn

15
Servers / Testing new server. Please bare with me! SkyCemetery
« on: July 09, 2017, 06:11:38 pm »
Hi,

My intention is to create mods and a server for this game because its hot. First my goal was to create a bigger universe. Right now I can spawn a system of 300 stars//1400stars//2800stars but at 2800 its lagging a bit. The thing is I don't know how to test my stuff online on the server so everytime i create a server in the server list of the game... It probably must piss off some people because i disconnect right away also. I am sorry for that as i do not know how to test my stuff offline. Just wanted to add that 2 other servers with my name SkyCemetery are appearing on the list I do not know why and they arent coming from me...

Ninekorn

Edit: nvm i found out that i can log in my server in the custom Multiplayer server list... Thats what ill do from now on until the server is up. If it ever will be. cant promise anything.

Pages: [1]