HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

I don't know if I was suposed to do this but... I have added some stuff

12-28-2002, 02:25 AM#1
algumacoisaqq
Well, I have just preplaced some units on the map. To do this, I modified the war3map.j file. I don't know if you guys don't want people messing around with these things, so if I'm doing somethig bad, just close this treat.
Ok, here's what i've done:

:mtk: Modified unit stats (things like color, size, Hp, thing you can do in the war3map.w3u). (Worked perfectly)

:mtk: Placed some units before the game started. (Worked ok, but the red guys started to fight the neutral hostile guys at the begining, and the neutral guys were not the same player of that neutral waypoint we have on a normal DMmoded game)

:mtk: Placed some custom crappy triggers (actually, it was only one crappy trigger) .(Worked almost ok, except that I've only tried with a very small trigger, so I don't know if it's going to be the same thing with larger ones, and the text got switched)

Ok, here's how i've done:

Modifying the unit stats was very easy, all you have to do is open a map on your war3 map editor, import the war3map.w3u in the DMMod\data\ folder, change whatever you want, then export it as war3map.w3u in the same folder (of course that you are a carefull boy and already have a backup of all these files). I don't know if you can place custom units (I think you can create them, but can't place them with the create unit command when you are playing as a DM).

Now, pre-placing units on the map was a little more hard, and you will need an MPQ thing to open your maps. What I've done was creating a map, placing some units to player0 (red) and some units to player neutral (hostile). After this, i saved the map, and opened it with winMPQ. I opened the war3map.j INSIDE the map I had just made, and the war3map.j in the DMMOD\data\ folder. Than I copied the thing realeted to the units I found in my war3map.j (the one inside the map i've created). That is: everything between the divisory of unit creation and triggers (this ones):

//**********************************************
//*
//* Unit Creation
//*
//**********************************************

// Lots of stuff

//**********************************************
//*
//* Triggers
//*
//**********************************************

Note the there isn't anything about this on the DMMOD war3map.j, so you don't have to worry about replacing stuff(at least in the current version).

Ok, There is more: After the Map Initialization Divisory, the is the function main takes nothing returns nothing. in this funtion, I placed the command call CreateAllUnits( ) (in the DMMOD war3map.j, it should allready exist in the other one), between the call SetMapMusic( "Music", true, 0 ) and the call InitBlizzard( ) commands. I don't know if it will work on other places of main, but that's where it is on the war3map.j that was generated by the map i've done.


Now, The trigger... First, I made a trigger that would display at text everytime an hero picked a moon key. Then, i saved it and opened the map with the winMPQ. In the war3map.j, the was the folowing things related to the trigger:

on Globals variables:

trigger gg_trg_Got_MoonKey_Copy = null // ->copy this

on Triggers: (note you don't really have to understand this, but you should know when it start and when it ends, stuff like this)

//============================================== -> copy all this...
// Trigger: Got MoonKey Copy
//==============================================
function Trig_Got_MoonKey_Copy_Conditions takes nothing returns boolean
if ( not ( GetItemTypeId(GetManipulatedItem()) == 'kymn' ) ) then
return false
endif
return true
endfunction

function Trig_Got_MoonKey_Copy_Actions takes nothing returns nothing
call DisplayTextToForce( GetPlayersAll(), "TRIGSTR_008" )
endfunction

//==============================================
function InitTrig_Got_MoonKey_Copy takes nothing returns nothing
set gg_trg_Got_MoonKey_Copy = CreateTrigger( )
call TriggerRegisterPlayerUnitEventSimple( gg_trg_Got_MoonKey_Copy, Player(0), EVENT_PLAYER_UNIT_PICKUP_ITEM )
call TriggerAddCondition( gg_trg_Got_MoonKey_Copy, Condition( function Trig_Got_MoonKey_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Got_MoonKey_Copy, function Trig_Got_MoonKey_Copy_Actions )
endfunction

//============================================== -> ...until here

on function InitCustomTriggers takes nothing returns nothing:
call InitTrig_Got_MoonKey_Copy( ) // -> copy this


So I copied this parts to the DMMOD war3map.j and placed them where they should be (on globals variables, in the InitCustomTrigger function, etc). It almost worked, expept that everytime a hero got a moonkey, it would say something about the DM waypoints. That's because the trigger in the war3map.j file only point to the "TRIGSTR_008" string, wich is a text located on the war3map.wts. In the map i had done, this strng had a "hey, you got a moon key" text, but in the DMMOD war3map.wts it was that DM waypoint string. Should be easy to fix, like using a "TRIGSTR_3408" or something, but I haven't tried this, I don't know if it will work.

Well, that was pretty much it, I don't really know if in the end, it will be worth the trouble, or if this isn't kind of taking part of the fun of DMMOD (after all, the DM exists so we don't have to use triggers), but any way, thanks for reading all this stuff, and if you have any doubts (I probably won't be able to answer them, because I have posted pretty much all I know about this, but anyway...) or comments, email me at [email protected]

Bye!
12-28-2002, 05:11 AM#2
Dinadan87
Damn, good job. If only I understood any of that, lol
12-28-2002, 04:02 PM#3
TucksMa
Basically Dude, if you're not sure it was OK to do something...
You should have asked first.

Editing of ANY files released with the DM Mod is NOT acceptable.
PLEASE do NOT distribute these files.

Get in touch with mikititan if you want distribute anything related to DM Mod.

:D
12-28-2002, 04:31 PM#4
algumacoisaqq
ok, sorry :(

I haven't distributed anything yet, I'm actually trying to make the first map using this kind of stuff right now, but I'm doing this a lot more to learn how these things work.
Ok, I'll wask, sorry about being so hasty.
12-29-2002, 11:45 PM#5
Nogumari
Its OK unless you involve it in any form of public activity.