Posted: Sat Jan 19, 2008 2:26 pm Post subject:
Make units drop ore when destroyed
Subject description: Im trying to change the resource system a little
Hello everyone.
first post and all that... you know. I did some searching but I'm not exactly sure what to search for, there isn't any mod that i know of that changes ore characteristics. Please forgive me if my answers are in some obvious place that i missed.
So to the problem. I would like to have unit spawn little bits of ore upon their destruction, thus giving the defender that extra little credit for fending off the attacker. This has been used in a game called BattleZone (first version) to create an extremely balanced gameplay, linking resource management directly to battle.
Well enough ramble now. I was thinking of giving a vehicle a death weapon that shoots ore ? or maybe make debris ore ?
(I'm using Tib*d ooooonly for its manual editor, please please please dont scream at me) QUICK_EDIT
Hey, i totally understand problems with Tibed, really, and I'm not planing to ditch it very soon.
And yes, thats exactly what I'm aiming for, IIRC in TS if you destroy a full harvester it would explode and drop tiberium everywhere. I would like it to drop half its unit cost as ore (same for buildings). (i don't think its possible with aircraft, is it? They crash down to the ground when destroyed). There will be a problem with naval units.
I dont have TS installed so i couldn't look in the ini's.
Thanks for your help _________________ --
To have faith in others, is first to have faith in yourself QUICK_EDIT
TiberiumHeal=yes didnt work, neither did setting IsTiberium=true on debris.
Dutchygamer, you say it is possible in some mods, can you name any you have came across ?
I dont have TS, I can only see remnants of Meteor code in RA2 YR.
Is there some tutorial explaining the hierarchy of the ini files? So far i can understand the unit > Weapon > Projectile > Warhead connections, but what about the ore? the ore drill isnt a building. How is it creating Ore? i would thought it would be firing ore as a weapon, but i think its much more complex.
An alternate solution would be to spawn a "crate" type object every time a unit is destroyed. I don't know how to link it to the cost of the unit though QUICK_EDIT
..the ore drills is a "Tree". or Terrain object. and no adding IsTiberium= won't work.
anyways. what you want lies in the Art.ini it should have a list of various tags there...so if TibEd removes them..I never used it..use Wordpad.
What your looking for is something along the lines of TiberiumToSpawn= or similar tag you add to the debris piece entry in there.
Then you list the name of the overlay entry it will spawn..ie [TIB01]..etc..make sure its a flat one, none of the angled tiberium images (cut from RA2). 1-12 I recall should work. anything over might crash on you..not sure.
also overlays are not the same as terrain objects they are usually walls, rocks and ore/gems/tiberium. etc _________________ Delirium.. QUICK_EDIT
I see what you are getting at. Ive been digging around this all evening now, Ive found TiberiumToSpawn=TIB01 on some other code, so i know thats correct, but you said to add this tag to the debris piece in art.ini? as far as Tibed tels me, Debris types are stored in RulesMD.ini ? am i wrong?
I cannot find any reference from debris type to overlay objects at all. And is tag IsTiberium=true needed? I saw it on the meteor code, labeled Meteor impact debris.
Thanks for help, in meantime im going to try some things with this. QUICK_EDIT
When the miner is destroyed, Tire voxels fly out of it, after they land there will be a single square of ore. See attached screenshot
So it does work. now i just have to figure out how to make it more stable, so that there is a nice amount of ore left, about 500 or something.
Would it possible to make it relative to the cost of the unit?
SCRN0001.png
Description:
First harvester destroyed, Note the wheel debris is present.
Filesize:
257.23 KB
Viewed:
7941 Time(s)
SCRN0002.png
Description:
These are the locations of ore tiles, sometimes if you are lucky the ore might hit the same tile and it would be more visible. I know ore is there because it can be targeted by another harvester just north.
Filesize:
403.91 KB
Viewed:
7941 Time(s)
_________________ --
To have faith in others, is first to have faith in yourself QUICK_EDIT
unforunately theres not really a way to scale up the value specifically but theres other codes like spawn radius and such that might get to what you want.
Rather than tire you can create a new animation that looks more like a ore fragment. CRYSTAL animations are good candidates. _________________ Delirium.. QUICK_EDIT
Ok well ive extraced the MOD that Bos187 suggested, and indeed it has a unit which explodes in little flying bits of ore, it is very nice and just how i want it. The unit which explodes with tiberium is a cyborg from TS (the mod combines units from TS into RA2 YR.
Here is the code from [TSCYBORG]:
Code:
; TS Cyborg
[TSCYBORG]
UIName=name:TSCYBORG
Name=Cyborg
Category=Soldier
Prerequisite=TSNAHAND
Primary=TSVulcan3
ElitePrimary=TSVulcan3E
Crushable=no
TiberiumProof=yes
Fearless=yes
Cyborg=yes
Pip=white
Strength=300 ; w350
Armor=light
TechLevel=3
Sight=6
Speed=4
Teleporter=yes ; significa que puede teletransportarse con la chrono-esfera...
Owner=Confederation,Arabs
AllowedToStartInMultiplayer=no
Cost=600
Soylent=200
Points=5
CrushSound=InfantrySquish
VoiceSelect=TSCyborgSelect ;These only work if you added the sound stuff correctly
VoiceMove=TSCyborgMove
VoiceAttack=TSCyborgAttack
VoiceFeedback=
VoiceDie=TSCyborgDie2
DieSound=TSCyborgDie2
Locomotor={4A582744-9839-11d1-B709-00A024DDAFD1}
PhysicalSize=1
MovementZone=Infantry
DamageParticleSystems=SparkSys
ThreatPosed=15 ; This value MUST be 0 for all building addons
ImmuneToVeins=yes
VeteranAbilities=STRONGER,FIREPOWER,ROF,SIGHT,FASTER
EliteAbilities=SELF_HEAL,STRONGER,FIREPOWER,ROF
Size=2;1
LeadershipRating=6
ImmuneToPsionics=yes
ImmuneToPsionicWeapons=no
SelfHealing=yes
Explosion=TWLT070,S_BANG48,S_BRNL58,S_CLSN58,S_TUMU60
IFVMode=0;2
;Parasiteable=no
AIBuildthis=yes
DebrisAnims=CRYSTAL1,CRYSTAL3,crystal3
MaxDebris=4
MinDebris=2
PixelSelectionBracketDelta=-8 ;es para la altura de la barra de vida
Sensors=yes
SensorsSight=2
Through a quick look i would say the ore is generated where DebrisAnims= tag is. CRYSTAL1 is green tiberium. CRYSTAL3 is blue tiberium.
if i try to apply this code to my War Miner it doenst work, it does the same thing by painting one tile with invisible ore. Does anyone have any suggestions? should i paste in the CRYSTAL1 and 3 code?
On a side note.. this is driving me crazy. Also im trying to get LAN networking working (<HA) and its a pain but this is offtopic, i cant expect anyone answering this. _________________ --
To have faith in others, is first to have faith in yourself QUICK_EDIT
you have to look in the Artmd.ini. also CRYSTAL animations need to be defined, The image is there it just those animation are not coded in. _________________ Delirium.. QUICK_EDIT
Yes i did code them in. ive coded CRYSTAL1 and CRYSTAL3, Copied it from the mod but changed a few things like the warhead to TankOGas (it was set to NEWTankOGas i presumed that the guy who made the mod changed the warhead as well, do you think that could generate the ore?) OK, here goes the code for the crystals:
Ok Ok i've just tried it again and i realized that the mod doesn't apply to saved maps, so i didn't realized this until now, so all my experimentation wasn't working
BUT !!
I have modified it quickly and now i have this code for the [CRYSTAL1]
What this code above does is launch about 3-4 shards up high in the sky but then they crash down with no ore where am i going wrong? _________________ --
To have faith in others, is first to have faith in yourself QUICK_EDIT
This is so weird, i just found out that it does indeed produce one square of ore, but then that ore starts to grow from that patch, im really confused now! i knew that ore production was confusing already but this is a whole new level !
Maybe im creating a tiberuim tree (drill) instead of just ore? that would explain the one square thing? _________________ --
To have faith in others, is first to have faith in yourself QUICK_EDIT
but what about it being only 1 square of ore? its a very small amount of money. and in Reloaded it drops about 3-4 pieces, and each spawn little 2-3 tile ore patches _________________ --
To have faith in others, is first to have faith in yourself QUICK_EDIT
Hmm, yea i was thinking about that on my way to uni. but then it came to me, debris can spawn more debris (like a large piece hitting the ground and spawing 3 little pieces) so what i will do is have 3-4 pieces fly off when the unit is destroyed, then when thouse pieces fall to the ground 5 more pieces of debris fly off (this time IsTiberium=true) thus i will get 5x3 squares of ore, that i think should be enough, although, do you think this will slow down the game? i hear messing with ore adds massive lag to network games...
Thanks for the help so far, i should have this sorted in no time ! _________________ --
To have faith in others, is first to have faith in yourself QUICK_EDIT
I know TiberiumRadius= makes it grow, so im going to take it off in a minute.
So i can confirm that ore tiles appear, but i need to increase quantity so they are worth real money.
Ok im going back to hacking, and will report soon.. _________________ --
To have faith in others, is first to have faith in yourself QUICK_EDIT
where is this "worth" tag you are talking about?
If there is a value tag for ore then i wish to find out.
So after some more xtensive testing ive came to a same conclusion that DragonFly came to some time ago = I could spawn ore, but just one square or lowest value ore (meaning that the ore in a tile is so sparse that you need a whole field to fill a miner).
If anyone has any suggestions, please come forward ! _________________ --
To have faith in others, is first to have faith in yourself QUICK_EDIT
is it possible to spawn an ore drill (an invisible one) upon destruction of every unit, and have that make some ore quickly and then disappear? If you cant make dense ore tiles, the only way to make them is to grow them with a drill right? _________________ --
To have faith in others, is first to have faith in yourself QUICK_EDIT
Last time I checked, ore generated by shp anims didn't grow or whatever (or at least caused major lag after a while) but your actual ore growth problem relates to time and some tags which need changing
Joined: 01 Feb 2007 Location: Las Vegas, Nevada, USA
Posted: Wed Jan 23, 2008 7:48 pm Post subject:
; This is Ore
[Riparius]
Name=Tiberium Riparius
Image=1
Power=0
Value=25
Growth=2200
GrowthPercentage=.06
Spread=2200
SpreadPercentage=.06
Color=NeonGreen ; **WARNING**: If you change this color, notify Bret_a
copied and pasted. im assuming yo made the tire the same..... but reading it sounds like you made a TIBTRE instead.... which is pretty much a drill.... im unsure if i am helpful at this point. im leaving this topic. lol. QUICK_EDIT
OK wow this is amazing, Ive done exactly like the guy in the post did (but hooked the debris to the a tank. whenever a tank explodes theres a mighty pile of ore right where it blew ! this is exacly how i wanted it this is great.
BUT .....
This creates another issue, because i have edited the global ore values now every ore field behaves weirdly, every time the drill turns a full patch of ore appears, as opposed to a small patch appearing.
so this leads me onto another question:
Is it now possible to spawn a different overlay item with ore-like properties, say using one of the other unused ores? that way global ore remains unaffected and i can change the look of the ore that i spawn.
And ideas?
(i can feel a mod coming here) _________________ --
To have faith in others, is first to have faith in yourself QUICK_EDIT
What about something like a crate type thing? or any other collectable item?
so that means i cant spawn gems? with GEM01 ?? _________________ --
To have faith in others, is first to have faith in yourself QUICK_EDIT
Ok ive tinkered about with this for long enough to post a solution:
first of all, ive used the well knows solution of spawning ore with debris
but then debris would only spawn one small tile, its not enough money there.
So by increasing ore growth rate (! not spread rate, growth rate relates to how fast can a single tile of small ore grow into a tile full of ore). This didn't affect normal ore fields adversely (perhaps making the ore grow abit faster, but this can be compensated by reducing the ore spread rate or something, basically make the ore grow faster, but make tiles appear less often)
A single tile of ore is worth 275 credits so you can control how much ore is spawn by how many pieces you release.
Unit code:
Code:
MaxDebris=6 ; maximim pieces of ore worth about 1400
MinDebris=4 ; minimum pieces, its a miner afterall
DebrisType=ORE ; type of debris, ORE is a voxel
DebrisMaximums=6 ; just to be sure
Debris code in RulesMD.ini
Code:
[ORE]
;Name=TiberiumShard
Name=Ore Chunk
Image=ORE ; this is a voxel i quicky knocked up
Elasticity=0.0
MinAngularVelocity=12.0
MaxAngularVelocity=24.0
MinZVel=40.0
MaxZVel=35.0
MaxXYVel=18.0
Duration=150
ExpireAnim=TWLT036
Damage=0
DamageRadius=0
Warhead=TankOGas
IsTiberium=true
TiberiumRadius=1 ; how many tiles to spawn, very unpredictable
TiberiumSpawnType=TIB07
Ore changes:
Code:
; This is Ore
[Riparius]
Name=Tiberium Riparius
Image=1
Power=0
Value=25
Growth=500 ; changed this, used to be 2200
GrowthPercentage=.06
Spread=2200
SpreadPercentage=.06
Color=NeonGreen
Ok so if everyone has no questions, complaints, or improvements this thread could use a lock since its a happy ending. Contact me if you have any questions.
Oh yea, and big massive kudos to Allied general, since the solution he found was just what i needed, thanks ! _________________ --
To have faith in others, is first to have faith in yourself QUICK_EDIT
Joined: 18 Jun 2005 Location: Dordrecht, the Netherlands
Posted: Sat Jan 26, 2008 6:14 pm Post subject:
Ehmm, is it just me, or must the tutorial still be put on ModEnc. With me, it only gives a page with the title of the tutorial, but nothing else... QUICK_EDIT
This tutorial will explain how to create patches (or tiles) of ore from flying debris. This can be used for many other purposes such as when hooked to a weapon it becomes an ore spawning weapon, Shoot a tile, and ore appears, and such.
This works on Red Alert 2 Yuri's Revenge 1.001 without rockpatch or npatch
Intro
There are 3 main elements to controlling ore:
* Generation of debris
* Debris piece that becomes ore
* Global ore properties
Generation of debris
Very easy to achieve with a DebrisTypes= tag, in practice harder to get working reliably, so start by picking a "guinea pig" unit which we will do all experiments on. I chose the Rhino Tank since you start with 4 of them in multiplayer.
In its properties add these tags as a test: ( Note: beware that there is a mistake in the original code, "Maxdebris=" should be "MaxDebris=" )
Code:
MaxDebris=6
MinDebris=4
DebrisTypes=TIRE
DebrisMaximums=6 ;Later on this one, i promise
The tags are self explanatory. Test the changes by blowing up a Rhino Tank in game, you should see 4 to 6 tires flying off the tank after it explodes, if it doesnt, you messed up.
Debris piece that becomes an ore tile
Now that we know the debris generation works, we shall play with TIRE voxel debris code now. Using TIRE again as our guniea pig.
at the bottom of the code add these tags:
Code:
IsTiberium=true
TiberiumRadius=1 ;how many tiles of ore we want around our impact
TiberiumSpawnType=TIB07 ;type of ore to spawn 1-12 works. gems are GEM01 - 12 i think.
Now if you test this in game you will see something very strange. If you check carefully you will realise that ore in fact is spawned by the TIRE debris, yet in such small amounts that its very hard to see. If this is the case next section should sort it.
Global Ore Properties
Be aware that we are changing the global ore properties, this means that it will affect not only the ore that we spawn, but also the ore that is grown naturally by ore drills. The effect is small but significant enough to look out for.
The problem with out new spawned ore patches is that they dont grow (by grow i mean the ore in the tile stays the same density, this has nothing to do with amount of ore produced by the ore drills).
In the ore properties we have 4 entries, all are different forms of ore (Tiberium, remnants from Tiberium Sun game)
[Cruentus] are gems
[Riparius] is ore
In [Riparious] section change this tag:
Code:
Growth=500 ;original value is 2200
Results
Start the game and blow up your tank. If you done everything correctly the tank should blow into several tires, those, when stop bouncing should create single full patches of ore worth 275 credits.
Cleaning Up
Now suppose you would like to hook this to every unit that is destroyed in game? its a bit rubbish leaving it as a tire. So... lets change it ! This means we need to do these things:
* Create a special ORE debris type
* Hook the ORE debris to units
* Create a voxel for the ORE
* Tweek parameters and looks
* Control the amount of ore expelled
Creating a new ORE debris type
Copy the code as it is from TIRE entry (same code that currently generates ore). Call it [ORE] leave everything as it is for now, we would like to test this first Remove 3 lines from [TIRE] that we added previously
[edit] Hooking the ORE debris to units
In our Rhino Tank change this line to:
Code:
DebrisTypes=ORE ; Was set to TIRE
And now test to see if it works exactly as it was before. If it doesn't, recheck everything.
Creating a Voxel for ORE
Create a ore looking piece (mine was 10x10x10 in size, looked alright) and name it ORE.vxl Put this file in the game folder and change the ORE entry like this:
Code:
Image=ORE ; was set to TIRE
Test the game once more.
Tweek parameters and looks of ORE debris
Now you know that everything works you can change how far the ore is flying out and where it lands, I made it land just short of where tires could go, i also changed Elasticity= tag to stop the ore from bouncing.
Warhead= tag isn't necessary
Control amount of ORE expelled
Tanks explode in ore, OK, but is that fair? now you can build tanks => kill them => mine the ore for profit? thats not fair at all now is it. So lets limit the amount of debris that is spawned by units.
Now you need to one rule about the DebrisMaximums= tag:
DebrisMaximums= must not be larger than MaxDebris= tag. Sounds stupid, its actually quite clever, for example:
Our Rhino tank is worth 900 credits, so about 3 ore pieces should cover it. i also want some tires to be expelled, but they shouldn't contain any ore
Code:
MaxDebris=5 ;total number of debris
MinDerbis=3 ;minumum number of debris
DebrisTypes=ORE,TIRE ;types of debris
DebrisMaximums=3,2 ;maximum nummber for each type
This way, when the tank blows up, you should get at combination of ore and tires, no more than 3 ore pieces, no less than 1 ore piece. sounds fair that.
You will have to go through every unit and change these tags to suit the unit cost, you might not want to add 2 debris types at all. _________________ --
To have faith in others, is first to have faith in yourself Last edited by fx3_hdrive on Sat Jan 26, 2008 6:37 pm; edited 1 time in total QUICK_EDIT
Oh dear, i do apologize DCoder, its first time i used a wiki, will remember that in the future. _________________ --
To have faith in others, is first to have faith in yourself QUICK_EDIT
im not sure how to do that, and Ive got my "mod" to finish up, but if you want to do it, by all means. _________________ --
To have faith in others, is first to have faith in yourself QUICK_EDIT
OOOOOOOhhhhhhhhhhhhhhhhh ive just discovered something !!!! its like so awesome !
If you remember from my tutorial, ive hooked up a warhead with damage to my ore debris. And ive discovered that if you fire upon the ore, it will diminish in density.
This means that you can control how much ore you release from the unit by giving the ore some damage properties so as soon as it hits the ground and creates a full tile, the damage ill regress the tile so the ore is sparse.
This isnt very significant, but im trying to gather as much info as possible on this in one place. _________________ --
To have faith in others, is first to have faith in yourself QUICK_EDIT
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum