Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Fri Mar 29, 2024 6:22 am
All times are UTC + 0
Spawning random crates with debris
Moderators: Global Moderators, Tiberian Sun Moderators
Post new topic   Reply to topic Page 1 of 1 [8 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
SuperJoe
Commander


Joined: 03 Sep 2009

PostPosted: Thu Jul 14, 2011 6:22 pm    Post subject:  Spawning random crates with debris Reply with quote  Mark this post and the followings unread

A while back I read LKO saying that you can spawn random crates with a building that has Wall=yes and ToOverlay=CRATE (can't remember the thread this was in). Anyway, since debris can be used to spawn tiberium, I tried to use the same logic to spawn random crates. To my surprise it actually works, though I still have some problems with it...

Start in art.ini. You need the same stuff as for tiberium spawning buildings. Note that these examples are from my quick tests, the values need to be adjusted so only the desired amount of crates spawn, and at the desired interval.

Code:

; Building active anim
[BUILDINGX_A]
Image=none
Normalized=yes
LoopStart=0
LoopEnd=10
LoopCount=-1
Rate=10
Surface=yes
NewTheater=no
DetailLevel=0
;DemandLoad=true
TrailerAnim=TSPAWNS1
TrailerSeperation=800

; Crate spawner
[TSPAWNS1]
Image=DBRIS1LG ;none ; Enable image only for testing
Elasticity=0.0
MinZVel=7.0
MaxXYVel=40.0
ExpireAnim=none
Damage=0
DamageRadius=0
Warhead=Organic
LoopStart=0
LoopEnd=14
LoopCount=5
Rate=10
DetailLevel=0
RandomRate=400,400
Bouncer=yes
Theater=yes
IsTiberium=true                  ; These 3 keys below are very important!!!
TiberiumSpreadRadius=1
TiberiumSpawnType=TIB12


Next in rules.ini, search for [TIB12] and change it to this
Code:

[TIB12]
Name=Goodie Crate
RadarColor=92,92,92
Crate=yes
CrateTrigger=yes
RadarInvisible=false
Land=Clear
DrawFlat=false


This should make the building active anim spawn random crates near the building. If you edited the crates to spawn only credits, this could be used to create a very clean, non-hacky supply drop building. The crate spawning interval and position should be adjustable with proper active anims and editing the TSPAWNS1 keys.

Now I have 2 problems with the logic so far:

1) I can't seem to make the crates visually appear as crates in the game. I tried to replace tib12.tem with a custom tib12.tem that has the crate image on all the frames (I've attached it to this post), but for some reason the game still draws tiberium where the crate spawns. The spawned tiberium also seems bit messed up and the palette is wrong.

2) The area where the crate spawned is also harvestable, which means another crate cannot spawn there until you have cleared it out with a harvester. I tried removing the IsTiberium=true, TiberiumSpreadRadius=1 keys from TSPAWNS1, but removing either or both of these keys resulted in no crates being spawned.

Also, I recall some talk that the game does not make use of all the Tiberium types? So using TIB12 for this crate spawning logic shouldn't make random crates appear in normal tiberium fields? Can someone confirm this since I might remember it wrong.



tib12.tem
 Description:
The custom tib12.tem with crate image

Download
 Filename:  tib12.tem
 Filesize:  6.88 KB
 Downloaded:  88 Time(s)


_________________

Back to top
View user's profile Send private message
SuperJoe
Commander


Joined: 03 Sep 2009

PostPosted: Fri Jul 15, 2011 4:03 am    Post subject: Reply with quote  Mark this post and the followings unread



ok I've got the two problems mentioned earlier fixed and the logic works pretty flawlessly now. Here are the changes to the code in the previous post (and explanations below):

Art.ini:
Code:

[TSPAWNS1]
...
IsTiberium=true
TiberiumSpreadRadius=0
TiberiumSpawnType=TIB17


Rules.ini:
Code:

[TIB17]
Tiberium=no
Image=CRATETEST
Name=Supply Crate
RadarColor=92,92,92
Crate=yes
CrateTrigger=yes
RadarInvisible=false
Land=Clear
DrawFlat=false
NoUseTileLandType=true

[TIB18]
Tiberium=no
Image=CRATETEST
Name=Supply Crate
RadarColor=92,92,92
Crate=yes
CrateTrigger=yes
RadarInvisible=false
Land=Clear
DrawFlat=false
NoUseTileLandType=true

[TIB19]
Tiberium=no
Image=CRATETEST
Name=Supply Crate
RadarColor=92,92,92
Crate=yes
CrateTrigger=yes
RadarInvisible=false
Land=Clear
DrawFlat=false
NoUseTileLandType=true

[TIB20]
Tiberium=no
Image=CRATETEST
Name=Supply Crate
RadarColor=92,92,92
Crate=yes
CrateTrigger=yes
RadarInvisible=false
Land=Clear
DrawFlat=false
NoUseTileLandType=true


Instead of trying to override tib12.tem, I created a new cratetest.tem and used Image=CRATETEST in rules.ini. This makes the crate appear correctly. As for tiberium being spawned around the crates, I noticed that if you use eg. TiberiumSpawnType=TIB16, the game randomly spawns nearby OverlayTypes around the area where the debris hit, in this case OverlayTypes TIB16, TIB17, TIB18 and TIB19. I first tried to use TiberiumSpawnType=TIB20 and the game spawned pieces of bridges next to the crates, since there is no TIB21 Laughing . I tested different values and with TIB17 the game didn't spawn bridge pieces anymore.

There is still one little problem. Tiberium cannot be spawned on top of certain surfaces, like pavement or roads. I'm not sure if there is a way to change it, and even if there is, it would probably make ordinary tiberium grow on pavement too... would need to be able to define it individually for each OverlayType to avoid problems.

Think this logic could be used to kind of emulate the oil derricks from Red Alert 2. Create a civilian structure (possibly indestructible), that spawns crates around it during certain intervals. Wouldn't require engineers, but would still create some interesting gameplay as players would race to capture the crates. I'm considering using the logic in my mod to make the Forgotten logistic center spawn crates at certain intervals. It would be bit like a superweapon / support power. And as I mentioned earlier, this could be used to create a pretty neat supply drop superweapon, as the cost of getting rid of the random crates (well, all crates would always spawn cash).

_________________

Back to top
View user's profile Send private message
Allen
Pyro Sniper


Joined: 13 Feb 2007
Location: C:\Westwood\ TechLevel=12

PostPosted: Fri Jul 15, 2011 4:15 am    Post subject: Reply with quote  Mark this post and the followings unread

Very nice!

It could work more like the RA2 oil derricks if the active anim is powered. So that if it was a Civ building it would be unpowed and spawn no crates but once take by a player it would become powed and spawn crates.

_________________


C&C in RA-1 Get it here
http://www.ppmsite.com/forum/viewtopic.php?t=30101 100+ Single Player Missions! Now playable on CnCNet 5!

Back to top
View user's profile Send private message
Krow
Commander


Joined: 30 Jan 2010
Location: Malaysia

PostPosted: Fri Jul 15, 2011 5:23 am    Post subject: Reply with quote  Mark this post and the followings unread

I want to say I love you, but I'm not that kind of guy. #Tongue
But still, good work SuperJoe! Approved

_________________
Team Black wrote:
interesting seeing your voxel work. They're still better than Aro's!

Back to top
View user's profile Send private message
SuperJoe
Commander


Joined: 03 Sep 2009

PostPosted: Fri Jul 15, 2011 6:37 am    Post subject: Reply with quote  Mark this post and the followings unread

Was thinking of something that doesn't even need this logic, just the Wall=yes and ToOverlay=CRATE trick that LKO described. You could buy a "structure" that costs 2000, and when you place it on the map it turns into a money crate. You could place the crate anywhere on the map (Adjacent=255). This would allow you to donate money to your allies, even to your enemies if for whatever reason you wanted to do that. The "donation structure" would even build alot faster than normal buildings, thanks to reduced wall construction times.

Or have an even more expensive structure that showers the area with random crates. Could be used to send help to allies or your own forces out in the field.

_________________

Back to top
View user's profile Send private message
Lin Kuei Ominae
Seth


Joined: 16 Aug 2006
Location: Germany

PostPosted: Fri Jul 15, 2011 7:47 am    Post subject: Reply with quote  Mark this post and the followings unread

Long ago i had such a logic implemented in TI too, but found the crates too powerful in multiplayer and since i didn't want to give them all only money, i dropped the logic again.

Some things you should take care of, if you haven't done already.
1. You don't need the name TIB17-TIB20. You can also use CRATE1-CRATE4, as TiberiumSpawnType spawns any overlaytype regardless of the name.
2. Put the new overlays at the end of the overlaytypes list, because the 4 different tiberium types are hardcoded to use overlays from a specific position in the overlaytypes list.

_________________
SHP Artist of Twisted Insurrection:  Nod buildings

Public SHPs
X-Mech Calendar (28 Mechs for GDI and Nod)
5 GDI, 5 Nod, 1 Mutant, 1 Scrin unit, 1 GDI building

Tools
Image Shaper______TMP Shop______C&C Executable Modifier

Back to top
View user's profile Send private message
Death Cultist
Scorpion Sniper


Joined: 28 Apr 2009
Location: Auckland, New Zealand

PostPosted: Fri Jul 15, 2011 8:18 am    Post subject: Reply with quote  Mark this post and the followings unread

Wait is it possible to decide what kind of crates spawn, because one could theoretically use this for a lot of things such as a spy satellite.

_________________
Beta Tester for Mental Omega 3.0


Back to top
View user's profile Send private message
Allen
Pyro Sniper


Joined: 13 Feb 2007
Location: C:\Westwood\ TechLevel=12

PostPosted: Fri Jul 15, 2011 8:33 am    Post subject: Reply with quote  Mark this post and the followings unread

Crates are random crates in MP games. You could make all crates reveal map but it would remove all other types of crates in the game.

_________________


C&C in RA-1 Get it here
http://www.ppmsite.com/forum/viewtopic.php?t=30101 100+ Single Player Missions! Now playable on CnCNet 5!

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [8 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
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


Powered by phpBB © phpBB Group

[ Time: 0.1585s ][ Queries: 13 (0.0092s) ][ Debug on ]