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 - ai_enabled

Pages: [1] 2 3 ... 62
Ok, sent you the build with new scripting API methods.

Ok, I will send you a build with this new API method later.

So, you need just an API method to get the crate containers nearby your ship - something like npc.GetAsteroidsByDistanceToN PC() but for crate containers?

Let me clarify how scripting works in VE.
All the JS files are loaded into isolated script engine instances. It means each script in the game (including topics) has independent global space. There are no shared global variables between script instances.
When you import another JS file into your JS file, its code is loaded separately into the same instance. But the global state is still not shared. So when you import another JS file, in fact, you're simply injecting its content into the importing JS file (it's totally different from C# "namespaces" concept, as you see). So that's why we also don't recommend importing huge JS files everywhere - only where you're really need.

Why is scripting in VE so limited? Because it was much easier for us to implement it this way. It allowed us to avoid many future problems. And we also using some global variables per-script/topic (from example, PLAYER_SHIP - when you're inside the topic script).

Another problem with global variables - we cannot serialize them easily and write into the savegame. So even if we had global variables (shared across all the scripts), it will be very easy to write bad code (which will prevent the game from properly saving the game state). So, we have storage scripting API instead. It's also very limited, but for the most cases, it was enough to get the things done.

Help section / Re: How to use ship.SetEquipmentCacheValue?
« on: August 02, 2017, 12:04:54 am »
Well it's not that simple... CalculateShip.js itself subscribing to OnCalculateNpcLeveledCache event:
Code: [Select]
actions.Bind("OnCalculateNpcLeveledCache", "CalculateNpcLeveledCache");I think the easiest way for you will be to modify CalculateShip.js (yes, it's hacky way...).

Another way is to create a new script, also bind to "OnCalculateNpcLeveledCache" and have your custom callback method for it (just copy CalculateNpcLeveledCache code from CalculateShip.js and modify for your needs). But it will work properly only in the case if OnCalculateNpcLeveledCache first handled by CalculateShip.js and then by your script. We don't have any API to setup callbacks priority, so you can try it and see if your method called after CalculateShip.js.

Help section / Re: How to use ship.SetEquipmentCacheValue?
« on: August 01, 2017, 11:11:34 pm »
unfortunately, for NPCs weapons are mapped directly from NPC XML, there is no way to change NPC weapons from scripting.
So, it makes sense to make a few NPC XMLs with particular weapons (per weapon type, multiple tiers). Giving too much choice to the player is something I would recommend to avoid as it might easily overwhelm the player. Consider having only a few presets for drones, the code generation for it is overcomplication and simply abusing the idea of XML's.

But you can modify NPC shield stats/properties, such as damage - as you found out, with the IMCache.
It's not recommended for mods to call ship.SetEquipmentCacheValue() - this method is intended to be used only by IMCache when it calculates "ship cache" (it combines stat values and bonuses from various sources and then applies them with ship.SetEquipmentCacheValue()). If you call this method directly you will overwrite the value set by IMCache (and if IMCache calculated any time later, it will overwrite your custom value). It's better to simply provide these values to IMCache instead. As you wrote, there is the CalculateShip.js script - and I think modifying it is the best way to do this.

Ideas and suggestions / Re: A few thoughts on the game.
« on: July 27, 2017, 02:35:11 am »
- It'd be nice to have an option to show shortcut numbers on the tool bar, just a little number showing 1 to 0 next to the icons.
BTW, we've added a subtle separation between two groups (5 slots each one) in closed alpha test #2. Not sure if anyone noticed it, perhaps it would be better if we split it into two separate panels.
I also tried to add shortcut numbers now and, in my opinion, it looks too dense and a little bit confusing:
(s1-s5 means press a shortcut while holding the Shift key)
But we definitely could have this as an option.

That sounds cool :-).


I don't know who wrote API :-)  but it's really unexpected API method name:
Code: [Select]
items.RemoveItemQuantity(int container_id, int item_id, int quantity);
(if the quantity is zero - remove item completely).

Servers / Re: [EU][kG] -PVE- / community server
« on: July 21, 2017, 07:56:38 am »
 2.0.1 is fine. No server-related changes were done.

Servers / Re: [EU][kG] -PVE- / community server
« on: July 21, 2017, 04:48:39 am »
Just connected, works great! Thanks for running the server, kyokei!

Modding info / Re: Item/skill icon
« on: July 20, 2017, 09:38:23 pm »
Roboto for most text, Orbitron for headers, for some other cases Eurostile.

Modding info / Re: How to make item unavaible in shop
« on: July 20, 2017, 09:30:55 pm »
Try to set the price to 0.

Servers / Re: Suggested (minimal) hardware for server
« on: July 20, 2017, 07:35:02 am »
After launching the server connect to it and look into the server log to see the stats (reported every few seconds). It will display how much milliseconds it takes for a frame. Usually the server run on 40 FPS so every update should not exceed 25 ms. And load increases nearly linearly if more star systems are active (populated with online players) simultaneously. So 10 players in 10 different systems might be overwhelming for described server hardware, but 10 players in up to 3-4 systems should be handled very smoothly.

Servers / Re: Suggested (minimal) hardware for server
« on: July 20, 2017, 07:31:37 am »
One core, 1.6 GHz desktop-class Intel or AMD CPU (not Atom), 1 Gb - should be more than enough.
If IO is slow, world saving may take a few seconds.
Bottomline - almost any VM on Linux will be good.

Pages: [1] 2 3 ... 62