Can I make a unit invisible? Without compiling the game.
I remember, there was the code for original (vanilla) Dune 2000, somewhere in internet. And I made invisible harvester.
Invisible unit. Is it possible?
Dune 2000.
Re: Invisible unit. Is it possible?
Yes you can.
You can create a custom map with custom rules in it.
Then if you play that map in singleplayer skirmish you will have the invisible harvester.
If you want to play that map with others online you have to upload it to resource.openra.net (resource center) first, then you can play online.
Yaml editing is fairly easy. A few lines of "code" will get it done (its not code)
Example for an invisible Red Altert harvester (append to the end of the map.yaml file you can find when opening an .oramap like a zip file):
I think thats it. The rest I think you can work out
See https://docs.openra.net/en/latest/release/traits/#cloak
Cheers,
SirCake
You can create a custom map with custom rules in it.
Then if you play that map in singleplayer skirmish you will have the invisible harvester.
If you want to play that map with others online you have to upload it to resource.openra.net (resource center) first, then you can play online.
Yaml editing is fairly easy. A few lines of "code" will get it done (its not code)
Example for an invisible Red Altert harvester (append to the end of the map.yaml file you can find when opening an .oramap like a zip file):
Code: Select all
rules:
HARV:
Cloak:
See https://docs.openra.net/en/latest/release/traits/#cloak
Cheers,
SirCake
Re: Invisible unit. Is it possible?
Thank you very much! It works (with some corrections).
Another question.
Now it works for all harvesters.
Can I on/off visibility for chosen harvester?
Something like this
(the example below does not work):
Error:
Exception of type `System.InvalidOperationException`: Cannot locate type: -CloakInit
-------
In general, can I change a value for one unit?
I try to change speed, for example.
I got error:
Exception of type `System.InvalidOperationException`: Cannot locate type: MobileInit
Another question.
Now it works for all harvesters.
Can I on/off visibility for chosen harvester?
Something like this
(the example below does not work):
Code: Select all
Actor61: harvester
Owner: Atreides
Facing: 96
Location: 7,21
-Cloak:
Exception of type `System.InvalidOperationException`: Cannot locate type: -CloakInit
-------
In general, can I change a value for one unit?
I try to change speed, for example.
Code: Select all
Actor61: harvester
(...)
Location: 7,21
Mobile:
Speed: 96
Exception of type `System.InvalidOperationException`: Cannot locate type: MobileInit
Re: Invisible unit. Is it possible?
In general, you can't have a single unit have different rules of the other units of the same type.
So all HARV harvesters must behave exactly the same (all cloaked).
What you can do is create a new unit type HARV1, which is similar to HARV except for cloak.
You can do this easily by using inheritance, but you also need to define the animation explicitly again:
(Not tested, Image may have to have all CAPITAL letters, try it)
If you need to turn it on/off cloak first tell me what causes it to turn on/off. It depends what to do next.
So all HARV harvesters must behave exactly the same (all cloaked).
What you can do is create a new unit type HARV1, which is similar to HARV except for cloak.
You can do this easily by using inheritance, but you also need to define the animation explicitly again:
(Not tested, Image may have to have all CAPITAL letters, try it)
Code: Select all
HARV2:
Inherits: HARV
Cloak:
RenderSprites:
Image: harv
Re: Invisible unit. Is it possible?
Thank you once more!
It works too.
But it takes some (slightly long) time to understand how to write it in Dune 2000. Not HARV, but harvester, for example.
The correct code is below.
(And it really does not work without RenderSprites)
In general, different harvesters for different sides (opponents). I did it.
Theoretically, it wolud be interesting to turn on invisibility under some conditions, during gameplay.
I slightly understand LUA code for Dune 2000.
It works too.
But it takes some (slightly long) time to understand how to write it in Dune 2000. Not HARV, but harvester, for example.
The correct code is below.
(And it really does not work without RenderSprites)
Code: Select all
Rules: d2k|rules/campaign-rules.yaml, d2k|rules/campaign-tooltips.yaml, d2k|rules/campaign-palettes.yaml, rules.yaml
harvester2:
Inherits: harvester
Cloak:
IsPlayerPalette: true
RenderSprites:
Image: harvester
In most simple case, player (me :-) ) has invisible harvesters, and enemy has not :-)If you need to turn it on/off cloak first tell me what causes it to turn on/off. It depends what to do next.
In general, different harvesters for different sides (opponents). I did it.
Theoretically, it wolud be interesting to turn on invisibility under some conditions, during gameplay.
I slightly understand LUA code for Dune 2000.