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 Sat Nov 30, 2024 9:07 pm
All times are UTC + 0
Basic Tutorial to adding New Crate Surprises
Moderators: Global 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
Rebelmoon
Rocket Infantry


Joined: 23 Jun 2006
Location: 3rd Rock from the Tiberian Sun

PostPosted: Mon Sep 17, 2007 5:30 am    Post subject:  Basic Tutorial to adding New Crate Surprises Reply with quote  Mark this post and the followings unread

This is a simple basic tutorial to adding new crate surpises.

In this we'll be adding a Predator crate so you'll only need to add 2 new xml files to your mod. The 1st is the GenericCrateSpawner.xml found in the Neutral/Units folder. The next is the UnitCrate.xml found in your Neutral/Crates folder. Make copies of both in your Mod/Data folder.

1st we'll make the Predators crate info. Open the UntiCrate.xml and look for the following code ID under Game Object.

<GameObject
id="UnitCrate"


Change the ID to:

<GameObject
id="UnitGDIPredatorCrate"


Next go to the following code under Behaviors:

<Behaviors>
<UnitCrateCollide
id = "ModuleTag_CrateCollide"
UnitCount="4"
UnitType="GDIPitbull"></UnitCrateCollide>


Change it to:

<Behaviors>
<UnitCrateCollide
id = "ModuleTag_CrateCollide"
UnitCount="1"
UnitType="GDIPredator"></UnitCrateCollide>


Finally, save it and then rename it as UnitGDIPredatorCrate.xml

Ok, that part is done. Next comes the GenericCrateSpawner.xml which tells the game what crates to spawn. This bit is simple and quick.

Open and find this code under Behaviors:

<Behaviors>
<SpawnCrateUpdate
id="ModuleTag_SpawnCrateUpdate">
<CrateList>MoneyCrateMP</CrateList>
<CrateList>VeterancyCrateMP</CrateList>
<CrateList>HealCrateMP</CrateList>


Just add your new crate name like this:

<Behaviors>
<SpawnCrateUpdate
id="ModuleTag_SpawnCrateUpdate">
<CrateList>MoneyCrateMP</CrateList>
<CrateList>VeterancyCrateMP</CrateList>
<CrateList>HealCrateMP</CrateList>
<CrateList>UnitGDIPredatorCrate</CrateList>


Save and you're done with that one.

Lastly, open your mod.xml and add both the GenericCrateSpawner.xml & UnitGDIPredatorCrate.xml files to it and save.

That's it. Just build and play. You will need to make a unit file for each unit you want added. And it's not just limited to units. Any number of things can be added, like exploding crates, etc, so play around with it and have fun.

Cheers,

Rebelmoon


Key Words: #Tutorials #Modding #TiberiumWars #KanesWrath #ModSDK 

Back to top
View user's profile Send private message Visit poster's website Skype Account
Kushan
Vehicle Driver


Joined: 02 Sep 2007

PostPosted: Mon Sep 17, 2007 1:27 pm    Post subject: Reply with quote  Mark this post and the followings unread

Nice tutorial!

I'm at work so I can't check the XML files myself at the moment, but is it possible to adjust the % chance of each crate appearing or would it be as simple as just adding multiple lines of the same crate?

Back to top
View user's profile Send private message
ravage
Soldier


Joined: 16 Jul 2005

PostPosted: Mon Sep 17, 2007 2:28 pm    Post subject: Reply with quote  Mark this post and the followings unread

I'm using the latter :p

Back to top
View user's profile Send private message
Rebelmoon
Rocket Infantry


Joined: 23 Jun 2006
Location: 3rd Rock from the Tiberian Sun

PostPosted: Mon Sep 17, 2007 3:36 pm    Post subject: Reply with quote  Mark this post and the followings unread

I've searched for a % modifier on this with zero luck so far, so I'm also using multiple instances of crates I want showing up more often.

One thing I left out of my tutorial is this in the unit file:

<DisplayName>NAME:UnitCrate</DisplayName>

You should change that to this:

<DisplayName>NAME:Crate</DisplayName>

If not, you will always know what type of crate you're grabbing. Something you don't want if you want the risk of grabbing a crate that might be a bomb. lol

It's up to each modder. Wink

Cheers,

Rebelmoon

Back to top
View user's profile Send private message Visit poster's website Skype Account
Gun Ship
Cyborg Soldier


Joined: 28 Jan 2006
Location: Melbourne, Australia

PostPosted: Tue Sep 18, 2007 8:36 am    Post subject: Reply with quote  Mark this post and the followings unread

Nice work Rebelmoon but isn't this suppose to go in the Blue Zone Tutorials forum?

_________________

Back to top
View user's profile Send private message Skype Account
Muldrake
Supreme Commander


Joined: 19 Sep 2003
Location: England

PostPosted: Wed Sep 19, 2007 12:44 pm    Post subject: Reply with quote  Mark this post and the followings unread

Moved to the tutorials section.

Nice work, Rebelmoon, thanks!

_________________
If there is a problem on the forums, PM me.

Back to top
View user's profile Send private message
Stygs
Cyborg Cannon


Joined: 27 Nov 2005
Location: Germany

PostPosted: Tue Dec 04, 2007 11:49 pm    Post subject: Reply with quote  Mark this post and the followings unread

*bump*

I am currently adding new crates for TWA (and this tutorial makes it kinda easy ^^), but i found a problem: I couldnt spawn squads.
Tanks work fine, but quads just wont apear, even through the codes are the same (just instead of 1 tank you should get 2 squads)

Any idea why?

EDIT: solved it using dummy units and death OCLs...

Back to top
View user's profile Send private message Skype Account
Shadow1981
Civilian


Joined: 07 Dec 2009

PostPosted: Fri Dec 11, 2009 5:07 pm    Post subject:  Basic Tutorial to adding New Crate Surprises Reply with quote  Mark this post and the followings unread

your Tutorial help me a lot but i can not get spawn squads to work sniper team, rifle squads, etc... plz help me

"EDIT: solved it using dummy units and death OCLs..." and this dose not help me because i have not got a clue what it is so plz help me out

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.2282s ][ Queries: 11 (0.0087s) ][ Debug on ]