wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 04-15-2010, 05:14 PM   #1
Sunwarrior25
I say!
 
Sunwarrior25's Avatar
 
Join Date: Jul 2007
Posts: 366

Submissions (3)

Sunwarrior25 will become famous soon enough (30)Sunwarrior25 will become famous soon enough (30)

Send a message via Yahoo to Sunwarrior25
Question How do I implement the Custom Race System?

I got the urge to add a custom race based off the Night Elves to a map with my previously created Bandit Race, BUT... The trigger I used didn't replace the units, and I was left with regular Night Elf. So! I decided to try out Archmage Ohwellencaster's (?) Custom Race System.

Unfortunately, regular Warcraft III disabled the trigger I put it in, and JNGP isn't really helping me either (At least, it left the trigger enabled when I saved). Basically, how do I use this? Keep in mind that I'm used to GUI, and have no idea where to put the structs that the API is talking about. The documentation says it replaces the Initialization Trigger, am I supposed to replace it physically? Or...?

I'm confused...
__________________
Table:
Currently:
- Fooling around with various things.
- Staying up WAY too late.
- Fooling around with various things.
Other places to find me:
YouTube
deviantART
Twitter
uStream
Sunwarrior25 is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 04-15-2010, 05:46 PM   #2
Michael Peppers
Lepus?
 
Michael Peppers's Avatar
 
Join Date: Jan 2009
Posts: 1,308

Michael Peppers is a jewel in the rough (188)Michael Peppers is a jewel in the rough (188)Michael Peppers is a jewel in the rough (188)

Default

This will take some time... alright, let's start, shall we? =)

Open the map with JNGP.

First of all, delete the Map Initialization trigger in the trigger editor... COMPLETELY. BASH IT, SMASH IT!!!!!!111!!1!
(Sorry, but that's fun =P)

Create a trigger called "CustomRaceSystem", convert it into custom script, delete everything that's in it and paste the Custom Race System there.

Create another trigger, convert it and delete everything etc. then add this:
Collapse JASS:
library YourRaceSetup initializer Init requires CustomRaceSystem
    
    private function Init takes nothing returns nothing
        local CustomRace c = CustomRace.registerAll("Your Race Name",RACE_NIGHTELF) //Use this if you want your race to overwrite the Night Elves. The first value is the name of your race.
//        local CustomRace c = CustomRace.create("Your Race Name",RACE_NIGHTELF,0.9) //Uncomment this and delete the line above if your race shouldn't overwrite the Night Elves. The first value is the name of your race, don't forget the "", the third one (0.9) is the handicap value, in this case 90%
        call c.setTownHall('etol')                  // Put the rawcode of your townhall here
        call c.addWorkerType('ewsp',c.NEAR_MINE,5)  // Worker rawcode
        call c.addHeroType('Ekee')                  // 1st Hero rawcode
        call c.addHeroType('Emoo')                  // 2nd Hero rawcode
        call c.addHeroType('Edem')                  // 3rd Hero rawcode
        call c.addHeroType('Ewar')                  // 4th Hero rawcode
        call c.setAIScript("elf.ai")                // Path to the AI script has to be put between the ""
    endfunction
    
endlibrary
Do everything I've written in the comments and you're set.

The AI is optional; if you don't have one remove the c.setAIScript() line.
Also remember that in JASS strings the slashes of the paths are doubled; for example 'MyStuff\MyAI.ai' becomes: "MyStuff\\MyAI.ai"

Whew! Speed typing tires me.

EDIT: If your race mines gold ala Night Elves use this script instead of the one above:
Collapse JASS:
library YourRaceSetup initializer Init requires CustomRaceSystem
    
    private function EntangleGoldMine takes player play, group workers, unit goldmine, unit townhall, unit randhero returns nothing
        call SetUnitPosition(townhall,GetUnitX(goldmine),GetUnitY(goldmine))
        call IssueTargetOrder(townhall, "entangleinstant", goldmine)
        call DestroyGroup(workers)
    endfunction

    private function Init takes nothing returns nothing
        local CustomRace c = CustomRace.registerAll("Your Race Name",RACE_NIGHTELF) //Use this if you want your race to overwrite the Night Elves. The first value is the name of your race.
//        local CustomRace c = CustomRace.create("Your Race Name",RACE_NIGHTELF,0.9) //Uncomment this and delete the line above if your race shouldn't overwrite the Night Elves. The first value is the name of your race, don't forget the "", the third one (0.9) is the handicap value, in this case 90%
        call c.setTownHall('etol')                  // Put the rawcode of your townhall here
        call c.addWorkerType('ewsp',c.NEAR_MINE,5)  // Worker rawcode
        call c.addHeroType('Ekee')                  // 1st Hero rawcode
        call c.addHeroType('Emoo')                  // 2nd Hero rawcode
        call c.addHeroType('Edem')                  // 3rd Hero rawcode
        call c.addHeroType('Ewar')                  // 4th Hero rawcode
        call c.setCallback(CustomRaceCall.EntangleGoldMine)
        call c.setAIScript("elf.ai")                // Path to the AI script has to be put between the ""
    endfunction
    
endlibrary
__________________
Projects:Tutorials: Competitive AI Step by Step with AI Editor (Pending)
Resources: [AI Script] Michael Peppers's Melee AI template (Pending)

Last edited by Michael Peppers : 04-15-2010 at 06:38 PM.
Michael Peppers is offline   Reply With Quote
Old 04-15-2010, 06:52 PM   #3
Sunwarrior25
I say!
 
Sunwarrior25's Avatar
 
Join Date: Jul 2007
Posts: 366

Submissions (3)

Sunwarrior25 will become famous soon enough (30)Sunwarrior25 will become famous soon enough (30)

Send a message via Yahoo to Sunwarrior25
Default

Thanks! Now I can get to testing/building this race!

EDIT: Apparently I have to +rep other people before I can +rep you again. :(
__________________
Table:
Currently:
- Fooling around with various things.
- Staying up WAY too late.
- Fooling around with various things.
Other places to find me:
YouTube
deviantART
Twitter
uStream

Last edited by Sunwarrior25 : 04-15-2010 at 06:53 PM.
Sunwarrior25 is offline   Reply With Quote
Old 04-15-2010, 06:58 PM   #4
Michael Peppers
Lepus?
 
Michael Peppers's Avatar
 
Join Date: Jan 2009
Posts: 1,308

Michael Peppers is a jewel in the rough (188)Michael Peppers is a jewel in the rough (188)Michael Peppers is a jewel in the rough (188)

Default

No worries, I can live without rep. =)
__________________
Projects:Tutorials: Competitive AI Step by Step with AI Editor (Pending)
Resources: [AI Script] Michael Peppers's Melee AI template (Pending)

Last edited by Michael Peppers : 04-15-2010 at 06:58 PM.
Michael Peppers is offline   Reply With Quote
Old 04-15-2010, 08:50 PM   #5
Sunwarrior25
I say!
 
Sunwarrior25's Avatar
 
Join Date: Jul 2007
Posts: 366

Submissions (3)

Sunwarrior25 will become famous soon enough (30)Sunwarrior25 will become famous soon enough (30)

Send a message via Yahoo to Sunwarrior25
Default

Whew! Ok.

On a completely unrelated note, I can't seem to balance this new race to an Undead AI rush.
__________________
Table:
Currently:
- Fooling around with various things.
- Staying up WAY too late.
- Fooling around with various things.
Other places to find me:
YouTube
deviantART
Twitter
uStream
Sunwarrior25 is offline   Reply With Quote
Old 04-15-2010, 09:17 PM   #6
Archmage Owenalacaster
Laughs Derisively
 
Archmage Owenalacaster's Avatar


Project Member: PoC
 
Join Date: Jun 2006
Posts: 649

Submissions (1)

Archmage Owenalacaster is a jewel in the rough (180)Archmage Owenalacaster is a jewel in the rough (180)Archmage Owenalacaster is a jewel in the rough (180)

Race-Building Contest #1 Winner

Default

Quote:
Originally Posted by Sunwarrior25
EDIT: Apparently I have to +rep other people before I can +rep you again. :(
Hi!

For future reference, please direct CRS questions to the CRS topic so I can actually see them. =)
__________________
I enjoy small text.
Resources: Custom Race System
JademusSreg.950, North American region on StarCraft 2
Archmage Owenalacaster is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 11:48 AM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2019, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services