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
Modding info / Re: Problem with script
« on: October 29, 2017, 10:09:01 pm »
@Teerawut, ok, post it here and we will try to help!

Development discussion / Re: CryoFall - Visual effects research (VFX)
« on: September 05, 2017, 04:14:11 am »
Tchey, we too, honestly.
Most of the post-effects we want to implement will improve the visual feedback of the game. When you receive serious damage or accumulating radiation it will be much more obvious than the simple status effects icons in the corner of the screen, and much more immersive too.
Most of these effects will be configurable (by the way, we recently finished the options system and menu, adding new options is very easy).
Though, some of the post effects will be forced (such as color grading for day-night cycle; I think everyone will agree it's not really good when the (vanilla) game allows to "turn of the night" in the options). But still, the modders are free to customize the existing post effects and even implement their own (yes, everything is implemented in the scriptable part of the game, including shaders code!). So we can expect a lot of crazy stuff and customization for every kind of player.

Development discussion / Re: CryoFall - new screenshots & news
« on: August 31, 2017, 11:51:44 pm »
I hope Linux is still a thing.
Sure, and .NET Core 2.0 was just released so it will be much easier. But there are still many obstacles as I wrote here

Modding info / Re: Problem with script
« on: August 23, 2017, 05:35:37 am »

it always returns an array of IDs (weapon items IDs).
If there are no ballistic weapons, the array will be empty.
So you can simply check the array length: if (ballisticWeapons.length == 0)...


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!

Pages: [1] 2 3 ... 62