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] 2
1
Here's the Google Drive link to a video of the project! It took me 1 month and a half to code a lot of stuff Inside of the program. I am using the AB4D DXEngine Oculus Wrap and the Ab4D Oculus sample and the SharpDX libraries! The video is 500mb long approx 26min. Sorry for the bad language in the video if there is any.

Enjoy watching.

https://drive.google.com/open?id=1m38AZpK5U77MSCW6ysHYfev6Vn3l_S62

ninekorn

2
Help section / Void Expanse Tutorials right in here!
« on: July 07, 2018, 12:18:21 pm »
FIRST TUTORIAL

Ok. The first tutorial is done. It's a bit long but it might help Modders of the Void Expanse community to setup their first custom Mod.

The first Tutorial is about setting up files and loading the Void Expanse server and also creating your first NPC Inside of the station from modifying the original script. Also you will learn how to create your first XML files for the game and where to put them for your first NPC.

The sound is a bit bad and video transitions weren't done correctly. But here it is:

https://www.youtube.com/watch?v=c-qHWtr8Om0

You can also download the project files from Google Drive in the comments below the video.

Other recommended references:
http://wiki.atomictorch.com/VoidExpanse/modding
http://wiki.atomictorch.com/VoidExpanse/scripting_api


3
Hey!

Some xml files have this:

Code: [Select]
<variables>
<var>some_variable</var>
</variables>

can we set them directly from inside the xml file for instance:

Code: [Select]
<variables>
<var>some_variable = 10</var>
</variables>


I am trying to avoid using Global Storage Variables for the market mod and having something like this below would really help.

Code: [Select]
<variables>
<var>price = 159</var>
</variables>



4
Help section / what is topic.EnableMonospaced(true)?
« on: May 18, 2018, 09:33:51 pm »
Hey!

I am trying to finish the market mod for release before the end of this month. As I had thought, the market mod was nearly completed months ago but beeing a little bit "egocentric" thinking about doing all my mods before releasing anything was just a bad idea... For the community, I will release them one by one if I can, starting with the Galaxy Market.

Before I stopped working on that mod like 7 months ago or something, I am not sure if the game was blocking me or not from the player buying items when he doesn't have enough money. I obviously now noticed the Console debugging me that "money that the player doesn't have is trying to be removed " -_-, but the items are still beeing transfered in the players storage. So it's one of the last things that needs fixing for the "buy" section of the market and I am working on it right now.

But looking at my script, I noticed I just copied the line topic.EnableMonospaced(true) without even knowing what it does. I didn't find any info in the scripting section of Void Expanse Wiki about this.

Anyone knows what it is?

nine

5
Bug reports / Some bugs/issues Reports!
« on: March 09, 2018, 11:40:43 pm »
removed.

6
There is a message in the console that is beeing displayed ever since I've created my test server today. It's never happened as much as it was doing so today. The message says
"[ERR] Ship not found: 0"
I think in the past, AI_enabled fixed one debug message like that but it was for Asteroids, if I remember correctly.
How does the fuel work in VoidExpanse?
Somehow, it feels like both the energy consumption and fuel consumption are linked together? I'm not sure if I'm wrong there.

7
The channel is free. I am not there to show that I am good at scripting nor to make money... I don't think I am that good. In fact I believe I have a LOT left to learn. But I made a mistake starting those mods. And that was to "disregard" the "haste" that is pretty much required for keeping an audience interested... I am talking about the community of course. It's been 6 months that I've release a video of my Galaxy Market in Void Expanse and 3 months later I had received 2 responses of the community on youtube here https://www.youtube.com/watch?v=Hp6zYf-7AzM . Also someone was interested in my drones mod here http://steamcommunity.com/workshop/discussions/18446744073709551615/2183537632735962702/?appid=324260 and I didn't respond. I have been working hours upon hours trying to make the best thing possible but I've just hit a wall of reality this weekend. I mean, I wasn't focusing on the right project, my idea was wrong from the start for the Drone Formation. I mean it's still a good idea that I will "convert" for other projects but it wasn't going to be effective for Drone Formations. And so this weekend I've decided to "burn" my whole Drone Formation project V1 and start with V2. It took me 1 day to create V2 and 3-4 months to make V1. So my whole project was taking too long. The tiny pathfind got me distracted. And the function StickToPoint wasn't giving me the perfect position at the right of the player and that's why I wasn't using it. In fact, I was using my own trigonometry functions to get the formation points. I am now using StickToPoint to make the drone Formations work and I will just offset the points a little bit to increase the number of formation points near the player. I am now starting V2 with StickToPoint and the V2 project is already way more advanced than V1. This is a good sign. Here's approx my current goals and a LOT of those functions already work, if not ALL OF them:

In the Drone Formation V1: worked 30 days just on the pathfind and the rest took 3-4 months
1. All different behaviors of the drones were separated and weren't even working together yet.
2. I worked 1 whole month for the AI Simple Pathfind and was able to make it work but it was completely USELESS for the project for what I wanted to use it for. The work on it is done
    though and so I will reuse it later anyway.
3. In that month, I was also able to put the drone in formation by following the best path it found from the pathfind it generated. The path was extra small and very effective. But as I
    said I was using this whole stuff the wrong way.
4. I had made a basic "Drone Go Mine" script that was working and don't remember where I put it in 2.5 terabyte of folders and projects and backups and whatnot....
5. I had made a basic "Drone Evade Projectiles" script that was working and don't remember where I put it in 2.5 terabyte of folders and projects and backups and whatnot....

In the Drone Formation V2: worked 1 day on it and it's already better than V1

      1.1 - AI Pick Formation:
         1.1.1 - The drone can follow the player. (coded)
         1.1.1 - If the drone is too far from the player it will go back to the player.
         1.1.2 - If the drone is getting in range of the player, it will get in formation.
         1.1.3 - If the drone is In formation but is ordered to go mine or attack, it will do so. (but V2 had a bug here where you could only send it mine once, after that it bugged)
         1.1.4 - If the drone is in formation but the player is "docking", it will dock with the player.
         1.1.5 - If the drone is in formation but the player is entering a jumpgate, the drone will jump with the player. (I might switch that later so if the drones are too far from the player
                    to remove their jumping capabilities)

      1.2 - AI Go Mine.
         1.2.1 - If the drone is commanded to go mining, it will go mine.
         1.2.2 - When the drone is mining, it gets a 2 seconds delay for each mining laser activation. For the moment, each mining laser activation gives them a minimum of 10 "Glepsite".
                    To be modified later.
         1.2.3 - Each 2 seconds, the mining laser yield is full and so the drone deposits the minerals in it's own cargo. Once it's own cargo is full, it will move towards the player and dropoff
                    it's own cargo unless the player's inventory is full.
         1.2.4 - If the player's cargo is full, the drone will not "try" to empty it's mining laser "yield" on the player. It will just stop mining once it's inventory is full and then go back to
                    formation instead of mining again.
         1.2.5 - If the player's cargo is NOT full, it will stop mining, and move towards the player until it hits a certain distance from the player to where it would stop.
         1.2.6 - Once the drone is stopped near the player, it will droppoff it's materials and then BAM it returns mine...
         1.2.7 - As long as there is space in the players cargo and an asteroid to find in the system, the drone will keep mining.
         1.2.8 - The drone is stopping it's mining operation if the player is too far, and if that happens, the drone returns near the player in Formation, instead of going back to mine.
     

      1.3 - AI Go Pick Containers.
         1.3.1 - to fill soon.

     1.4 - AI Go Combat.
         1.4.1 - to fill soon.


I will be trying to code all nights from 09h00pm to 01h00am every night of the week and more in the weekends. I might also in the weekends. I have a job during the afternoon and so I can't work there for the moment. At some point, I might switch from night to morning.

If you people have any ideas as to how I could "better" my mods please feel free to contact me. You can also come in the TwitchTV channel and just give me a flurry of "swears" or a flurry of "you suck buddy" and that's gonna make my day!  ;D

Anyhow, it's free, and it's for Void Expanse's Community!
nine









8
Help section / Is there a IMCache.GetValue and IMCache.SetValue?
« on: February 03, 2018, 06:13:03 am »
Hi,

In the CaculateShip.js there is a bunch of IMCache.AddValue like:

Code: [Select]
IMCache.AddValue("maneuvering_value", 1 + lerp * 0.1);
Can we also access and modify those values IN-Game with the .js scripts?  I am trying to get more control over the drones NPC basic "settings". I've tried

Code: [Select]
IMCache.GetValue("maneuvering_value");
IMCache.SetValue("maneuvering_value",10);

var allEffects = ship.GetAllEffects();
var defaults = ship.GetDefaultEffects();
var invCache = ship.GetEquipmentCache(SHIP_ID);
var skillCache = ship.GetSkillsCache(SHIP_ID);
var buffsCache = ship.GetBuffsCache(SHIP_ID);

But only the ship.GetAllEffects() works... As in it doesn't debug an empty array. When I tried to debug the others, I get "undefined". So modifying the equipment values or skill values IN-Game doesn't seem to work for me right now. Even http://wiki.atomictorch.com/VoidExpanse/scope-ship states that we can use SetEquipmentValue like:

Code: [Select]
ship.SetEquipmentCacheValue(SHIP_ID, "maneuvering_value", 10);
var invCache = ship.GetEquipmentCache(SHIP_ID);

But even that debugs me "undefined" so I am not sure what else to try. There doesn't seem to be a template as to how to get access to those values anywhere on the web and the wiki page.  I've searched all the other Big Mods contents with Notepad++ and no other Modders used those settings in their scripts either.

Thanks in advance for the help!
nine

9
Hi anyone who will read this.

I've been working my ass off for 1 month ever since 24rth December to try and get the Drone Mod going forward. I already had a LOT of functions for the Drone Mod working like:

1. drone, go pick near containers,
2. drone, go mine,
3. drone, go empty inventory,
4. drone, go attack enemies in range,
5. drone, follow player,
6. drone, go repair yourself if not at full hp,

but without the drone formation function, the drones would just hit each other and collide with everything around them and just it wasn't really nice to watch.

And as AI_enabled suggested to me for the drones, Drone Formations would be a great idea. Things are getting great after one month of working hard on it. I've decided to implement a simple, very very simple pathfind, that just activates when the Drone is 5-10 Void Expanse Units distance from the player. This pathfind is NOT a grid 10*10 or whatever because that would've been too much overhead if a lot of Drones on the server. It's actually a simple pathfind that iterates a selected number of times and gets the 8 neighboors out of where the Drone is and right away calculates the best node gcost - fcost - hcost. This makes it so that instead of generating a whole 10*10 grid and applying the whole gcost etc to all of those nodes, it just applies those "costs" to the neighbooring nodes and selects the best node out of that pile and just removes the rest... I make it iterate 5 times for the moment and it's VERY effective to get the drone in position (of course, I still need to code the drone speed and make it use it's thrusters to get in position near the player)... But there is an issue. I am making 3 calculations using Math.sqrt to get the length of Vector2d needed for the drone to calculate the dot product... It's complicated to explain but anyway... I've got that whole part working but you must imagine that 3 sqrt per 20 decisions per seconds is 60 sqrt calculations for each drone per seconds WHEN the drone activates it's pathfind... Which is without a doubt, out of the question, to be in the final version of the drone mod. I mean this isn't a single player game so 100++ drones would maybe/probably make the server lag ... And so searching the web to find a solution, i've stumbled upon the FAST Quake 3 inverse Sqrt function that doesn't make use of Math.sqrt. But the thing is Void Expanse, as mentionned by AI_enabled, uses ECMASCRIPT 5 (strict mode). And things like:

Float32Array
Uint32Array
Int32Array
ArrayBuffer
Float.intBitsToFloat
Float.floatToIntBits

aren't recognized by ECMASCRIPT5 which makes all of those following reference functions not work...

https://stackoverflow.com/questions/11513344/how-to-implement-the-fast-inverse-square-root-in-java
https://gist.github.com/jhermsmeier/2269511
https://gist.github.com/bga/628591/07151f342022ad413bbb0d5b2846b7d80fe103fb
https://gamedev.stackexchange.com/questions/30727/implement-fast-inverse-square-root-in-javascript
https://gist.github.com/Starfys/aaaee80838d0e013c27d
https://www.beyond3d.com/content/articles/8/

This is complicated stuff for me at my current scripting experience and so if any of you guys in this community know what the heck I am talking about (because even I don't really understand those functions anyway), please feel free to give me some hint as to HOW I could calculate a position next to a player by normalizing a Vector2d without using Math.sqrt.
The way that I am doing it works but it is bound to lag if there is a LOT of drones on the server. I am going to keep working on the Drones for sure because whatever I learn while coding some AI stuff is not a loss to me, on the contrary, because I am pretty sure I could convert my whole scripts to C# anyway when I code in Unity3d.

So yeah, the moment that the drones get in formation and that it doesn't lag the moment that they first activate their pathfind (it doesn't lag after the first pathfind generation somehow), then I will start coding the Drone "control drift" function so that the drone itself uses it's thrusters to get to it's formation position at the fastest speed possible by using the path it generated from it's pathfind.

Anyway, to anyone who read this,
Thank you in advance.
nine


10
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

11
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

12
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);
}
}
}
}




13
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.

14
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.

15
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

Pages: [1] 2