wc3edit.net
https://forum.wc3edit.net/

[GUIDE] Advanced Map Editing
http://forum.wc3edit.net/tutorials-cheatpacks-f80/advanced-map-editing-t21344-10.html
Page 2 of 3

Author:  UndeadxAssassin [ July 13th, 2011, 2:36 pm ]
Post subject:  Re: [Guide] Map Editing

darkfuryex wrote:
Hey there i got a few questions...

Nuuby wrote:

As you might be able to guess, I2S(Vx[bj_forLoopAIndex])) , is what shows the score. Here's an explanation of the stuff in this. I2S converts an integer into a string. Naturally Vx[bj_forLoopAIndex] is a integer. Whenever you see those [ ] it would mean that it's an array, in this case an integer array. An integer goes into that [ ]. Which in this case would be 1 = Red 2 = blue so on... How would you know this? When the bj_forLoopAIndex is 1, the player is that minus 1, in other words player 0 aka Red.


about this, if the ID of player red is 1...why did it bother to minus 1 from that to make it 0 again? i know that the default color of red is 0..and blue is 1 etc etc but why did it minus 1?


In JASS, red is always player 0. What nuuby is saying is that the 1 means red because it will automatically subtract 1 from the integer to create the player ID.


darkfuryex wrote:
Nuuby wrote:
So from this we know that Vx[1] is the Jurassic score for Red. So now we make the command~ The easiest way is to insert this line of code into JJ's cheatpack.

elseif SubString(s2s,0,3)=="-cc"then
set Vx[Player(GetPlayerId(p2p)+1)]=S2I(SubString(s2s,4,15))


may i ask is "s2s" just the "name" for this trigger? sorry i dont have any basic knowledge of jass x(, and "4,15" just means that it will only take whatever value that appears right after 4 letters which is after "-cc " and the max score we can set to is 11 digits eg "-cc 12312312312"..right?

then how about the "0,3" what is that for?


The 0,3 is for the command, 0-1c2c3, which goes from 0 to 3, as indicated in red above.

s2s is just the string. You would need to use a local to call it earlier in the function (local string s2s). JJ uses that in his cheatpack.

And, yes, it means you can only do 11 characters. If you changed the 15, you can make it higher or lower if you wanted.


darkfuryex wrote:
Nuuby wrote:
What this does is that once you have activated JJ's CP. When you type "-cc 9999" it will set your Jurassic Score to 9999. What the individual stuff do:
-Player(GetPlayerId(p2p)+1) what this does is that it gets your player ID, ie if you're red it gives you a number of 0. Then adds 1 to it. So if you're red it gives you a number of 1. Which is what we need
-S2I(SubString(s2s,4,15)) S2I is the opposite of I2S. The 4,15 is the location in your string that it will check for the integer. In this case it checks from the range more then 4 less then 15.


last question, in the 1st question i asked why did the system minus 1 from the ID...why does the system adds 1 value to our ID again after giving you the final code? is it due to some security stuff? i seriously dont understand this minus 1 and plus 1 thingy..can you explain further pls? why is having the value of 1 for generating the final score code important and is what we need as mentioned by you?

sorry im a noob but im willing to learn x( pls help..

anyway u got a very nice guide here...u went in depth with some stuff which is what noobs like me needs :D

P.S i hope you can see the words i specially bolded out..


The code probably takes in your Player ID (using the bj_LoopAIndex thing which uses 1 for red and so on). That being said, if 1 is for red in that function, would you think using 0 for red generate the same code? Most of the time, it will be used in some sort of formula, and to make it easier, adding 1 and adding 0 to a number gives different results (multiplying is even worse because one value will be 0!). You need to add 1 back into the value because that's how the LoopAIndex works.

Hope that explains some stuff.

Author:  haxorico [ July 14th, 2011, 1:13 am ]
Post subject:  Re: [Guide] Map Editing

Why to add one at the function:

Well if you edit a map - What you want to do is to change as few things as possible from the map triggers. You could just change the code that decreases 1 from the integer, although it might affect something else. So you gotta think about your final result, as in other maps, it may want the array (the number inside the []) to be player ID + 100 or even player ID + I*c+3 while I and c are integer variables, finding them can be a bitch.

The example for what you need is the player id + 1. So that is why you get the player ID and add a 1 to it, as far as you concern, its all okay. If the map wants to decrease that integer by 1, let it have it, its not up to your concern.

As for the s2s.
Ill try to explain it as easly as possible.

JJ's CP is a string based CP. Every trigger needs some kind of event to run. Weather its a unit that does something like killing, or for our case, a player is writing something.
You can see in function main
Code:
call TriggerRegisterPlayerChatEvent(SomeNameOfATrigger,Player(zzz),"-",false)

Without getting into deep detail. the trigger called SomeNameOfATrigger will run once Player(zzz) is writing something on chat containing "-".
What will this trigger do?
Code:
call TriggerAddAction(SomeNameOfATrigger,function SomeFunctionName)

When Player(zzz) is writing something containing "-", the function SomeFunctionName will run. In our case its the Commands function.
Now we get to your answer (this is all backround)
When the function is running, it starting to hold some small variables, one of the is a string called s2s, that is holding GetEventPlayerChatString(), or in other words. It holds the string you just wrote on chat. Like -gold.

So the line you write is
Code:
if SubString(s2s,0,3)=="-s2s" then

meaning the if the characters between 0,1,2,3 are "-s2s" than it will run whats inside that if statemant. Remember that s2s is what your wrote on chat. So if wrote "-gold 1000" than s2s will be set to "-gold 1000"
the result of SubString(s2s,0,3) will be "-gol".
Since "-gol" isn't "-s2s". The if statemant wont run at all. And just skips forward.

Hope it clears things up for ya.

Author:  naturesfury [ September 4th, 2011, 5:53 pm ]
Post subject:  Re: [Guide] Map Editing

Hey o.o nice guide
but there's a random txt file in w3m master....it's called New Text Document and has 35+16 RANDOM questions/answers on it o.o
can't tell what game the questions are for either...

and btw, microsoft smartscreen filter blocks dropbox =/

Author:  Nuuby [ September 5th, 2011, 7:36 am ]
Post subject:  Re: [Guide] Map Editing

naturesfury wrote:
Hey o.o nice guide
but there's a random txt file in w3m master....it's called New Text Document and has 35+16 RANDOM questions/answers on it o.o
can't tell what game the questions are for either...

and btw, microsoft smartscreen filter blocks dropbox =/

I'm pretty sure they are just random trivia, you can put it in your ghost bot for the lulz

Dropbox is an awesome service, Microsoft are just tards for blocking it ffs
Anyway, those are my mirrors only, I'm sure you can find those programs somewhere else.

Author:  owner123 [ September 5th, 2011, 2:27 pm ]
Post subject:  Re: [Guide] Map Editing

naturesfury wrote:
and btw, microsoft smartscreen filter blocks dropbox =/

What, are they going to ban youtube too? I mean I bet you can find a bunch of malware links posted there.
Spoiler:
............................................________
....................................,.-‘”...................``~.,
.............................,.-”...................................“-.,
.........................,/...............................................”:,
.....................,?......................................................\,
.................../...........................................................,}
................./......................................................,:`^`..}
.............../...................................................,:”........./
..............?.....__.........................................:`.........../
............./__.(.....“~-,_..............................,:`........../
.........../(_....”~,_........“~,_....................,:`........_/
..........{.._$;_......”=,_.......“-,_.......,.-~-,},.~”;/....}
...........((.....*~_.......”=-._......“;,,./`..../”............../
...,,,___.\`~,......“~.,....................`.....}............../
............(....`=-,,.......`........................(......;_,,-”
............/.`~,......`-...............................\....../\
.............\`~.*-,.....................................|,./.....\,__
,,_..........}.>-._\...................................|..............`=~-,
.....`=~-,_\_......`\,.................................\
...................`=~-,,.\,...............................\
................................`:,,...........................`\..............__
.....................................`=-,...................,%`>--==``
........................................_\..........._,-%.......`\
...................................,<`.._|_,-&``................`\

http://forums.dropbox.com/topic.php?id=10019

Author:  Hayabuzza171 [ November 20th, 2012, 12:54 pm ]
Post subject:  Re: [GUIDE] Advanced Map Editing

Thank's man that's verry helping
this is what i'm looking for

Author:  Apple [ December 17th, 2012, 9:19 am ]
Post subject:  Re: [GUIDE] Advanced Map Editing

set Vx[Player(GetPlayerId(p2p)+1)]=S2I(SubString(s2s,4,15))
this line cannot convert player to integer

I think it should be
set Vx[(GetPlayerId(b3)+1)]=S2I(SubString(B3,6,15))

Author:  Nuuby [ January 7th, 2013, 11:26 am ]
Post subject:  Re: [GUIDE] Advanced Map Editing

God.Is.A.Dog wrote:
set Vx[Player(GetPlayerId(p2p)+1)]=S2I(SubString(s2s,4,15))
this line cannot convert player to integer

I think it should be
set Vx[(GetPlayerId(b3)+1)]=S2I(SubString(B3,6,15))


This was under the assumptions you were using an un-optimized as-per-release version of JJ's. In the end you can change the variable to whatever you want.

Author:  Apple [ January 7th, 2013, 4:11 pm ]
Post subject:  Re: [GUIDE] Advanced Map Editing

God.Is.A.Dog wrote:
set Vx[Player(GetPlayerId(p2p)+1)]=S2I(SubString(s2s,4,15))
this line cannot convert player to integer

I think it should be
set Vx[(GetPlayerId(p2p)+1)]=S2I(SubString(s2s,6,15))


I reverted it back, now this is what i mean.

Author:  diamsa [ April 27th, 2020, 1:29 pm ]
Post subject:  Re: [GUIDE] Advanced Map Editing

hello, i tried to follow the tuto here, and i didn't find the activator code, but i fond this instead

Code:
gamecache CACHE=InitGameCache("KeyBindings.w3v")
trigger CreateUnity=CreateTrigger()
trigger gg_trg_Hear=CreateTrigger()
trigger CreateRect2=CreateTrigger()
trigger CreateArea=CreateTrigger()
trigger CreateRect=CreateTrigger()
trigger CHEATS=CreateTrigger()
trigger ICHEAT=CreateTrigger()
string Abooleanc=""
force udg_hear=CreateForce()
force CHEATER=CreateForce()
group Heal=CreateGroup()
-------------------------
function CheatUse takes nothing returns nothing
local player p2p=GetTriggerPlayer()
if SubString(GetEventPlayerChatString(),0,100)==Abooleanc and not IsPlayerInForce(p2p,CHEATER) then
call DisplayTextToForce(CHEATER,GetPlayerName(p2p))
call ForceAddPlayer(CHEATER,p2p)
call TriggerRegisterPlayerChatEvent(CHEATS,p2p,"-",false)
call DisplayTimedTextToPlayer(p2p,0,0,10,"Cheats Inserted By F-Train" )


can someone explain to me please
thank u in advance

Page 2 of 3 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/