Betelgeuse wrote:a few of functions that came from irc discussions (should I make tickets for each of these?)
(itmSetFrequency UNID frequency) ;sets the frequency of an item
(staSetLevelFrequency UNID levelFrequency) ;sets the level frequency of a station
this would allow us to remove old items and stations (both static and dynamic) without breaking the game
(shpSwapWeapon ship equippedItem itemToBeSwapped) -> the swapped out item ; you would use this to install the itemToBeSwapped preserving weapon selected
(shpSwapArmor ship equippedItem itemToBeSwapped) -> the swapped out item ; you would use this to install the itemToBeSwapped preserving hp without
(shpSwapShield ship equippedItem itemToBeSwapped) -> the swapped out item ; you would use this to install the itemToBeSwapped preserving hp
I don't quite get how itmSetFrequency and staSetLevelFrequency would help. We would still have to search all systems for the existing type to see if you're about to remove a type that is in use. [It's actually worse than that: some script may have hard-coded the type; when they try to create it they will get a runtime error. For example, imagine deleting the type for a Phobos--then the script for the CSC mission would fail. Or consider the a script that enumerates all types that match a criteria and saves those UNIDs somewhere--again, that would break.]
For the shpSwap* function, I would write a ticket for a single function that does the right thing depending on the type.
it wouldn't solve the problem I admit but it would certainly help, we would still have the old stuff in xml so that isn't a problem.
This isn't about removing them from the game, I would just like them not to randomly appear anymore.
Betelgeuse wrote:it wouldn't solve the problem I admit but it would certainly help, we would still have the old stuff in xml so that isn't a problem.
This isn't about removing them from the game, I would just like them not to randomly appear anymore.
I like that. I'm already planning on adding code that controls that at the adventure-level. Might as well have a function to control it dynamically. Go ahead and add it as a ticket. It will probably be scheduled for 1.09.
The point of the swap functions is to be able to transparently upgrade/change the players installed devices without any unwanted sideeffects. To clarify what Atarlost said, he already has tlisp code that handles shpSwapArmor, shpSwapShield and shpSwapWeapon. The only thing that we really need is the ability to determine and set currently selected weapon and set ammo for launchers. Also, to swap out armor, we damage the replacement segment until it matches the previous. All that is needed there is to be certain the red flashes are suppressed when damaging the segment in code.
The other way is to create the type using script. You can add a <OnGlobalTypesInit> to any type (not just TemplateType). Inside of OnGlobalTypesInit you can call typCreate as appropriate.
[Note: Inside of OnGlobalTypesInit you can call typCreate on existing type UNIDs (to override them); outside of it you can only call typCreate with new UNIDs created with typGetDynamicUNID.]
new problem I can't seem to get random to work in the struct definition.
itemDamage : (random '("damage='laser:3d6'" "damage='particle:1d8'"))
makes itemDamage an empty string
this is so cool, build your own weapon lab, here I come!
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"
Betelgeuse wrote:new problem I can't seem to get random to work in the struct definition.
itemDamage : (random '("damage='laser:3d6'" "damage='particle:1d8'"))
makes itemDamage an empty string
Doh! Sorry about that. Looks like structs are not being evaluated properly.
BTW: If you want to test stuff like this you can now use TransData. Try:
Betelgeuse wrote:new problem I can't seem to get random to work in the struct definition.
itemDamage : (random '("damage='laser:3d6'" "damage='particle:1d8'"))
makes itemDamage an empty string
Doh! Sorry about that. Looks like structs are not being evaluated properly.
BTW: If you want to test stuff like this you can now use TransData. Try:
You will get a command prompt that evaluates TLisp expression.
O.O COOL!
"Dash_Merc - George is a genius, in that he created this game engine that is infinitely extendable"
"<@sheepluva>Good night everybody, may the source be with you." <-- FOSG dev
"You only need THREE tools in life - WD-40 to make things go, Duct Tape to make things stop And C-4 to make things go away"