wc3edit.net

United Warcraft 3 map hacking!
It is currently April 16th, 2021, 3:38 pm

All times are UTC




Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject: Re: [JASS] JJCP: NewGen
PostPosted: August 25th, 2020, 8:54 am 
Offline
Newcomer

Joined: October 26th, 2019, 11:54 am
Posts: 22
throw the full list of pliz commands.


Top
 Profile  
 
 Post subject: Re: [JASS] JJCP: NewGen
PostPosted: August 26th, 2020, 10:17 pm 
Offline
Super Moderator

Joined: February 3rd, 2009, 11:28 pm
Posts: 2392
It's available here: http://forum.wc3edit.net/tutorials-chea ... 13526.html


Top
 Profile  
 
 Post subject: Re: [JASS] JJCP: NewGen
PostPosted: March 6th, 2021, 1:15 pm 
Offline
Super Moderator
User avatar

Joined: February 24th, 2009, 1:31 pm
Posts: 3807
Location: JEW LAND
owner123 wrote:
Because copying units was never programmed:
Code:
function CopyHero takes unit source, integer uid, real locX, real locY returns nothing
local integer pid = GetPlayerId( GetOwningPlayer( source ) )
local real facing = GetUnitFacing( source )
   if uid == 0 then
      set uid = GetUnitTypeId( source )
   endif
   if IsUnitType( source, UNIT_TYPE_HERO ) then
      set bj_lastCreatedUnit = CreateUnit( Player( pid ), uid, locX, locY, facing )
      call CopyStats( source, bj_lastCreatedUnit )
      call CopyItems( source, bj_lastCreatedUnit )
      call CopyState( source, bj_lastCreatedUnit )
   endif
endfunction

I think it can be updated like this:
Code:
function CopyHero takes unit source, integer uid, real locX, real locY returns nothing
local integer pid = GetPlayerId( GetOwningPlayer( source ) )
local real facing = GetUnitFacing( source )
   if uid == 0 then
      set uid = GetUnitTypeId( source )
   endif
   if IsUnitType( source, UNIT_TYPE_HERO ) then
      set bj_lastCreatedUnit = CreateUnit( Player( pid ), uid, locX, locY, facing )
      call CopyStats( source, bj_lastCreatedUnit )
      call CopyItems( source, bj_lastCreatedUnit )
      call CopyState( source, bj_lastCreatedUnit )
   else
      set bj_lastCreatedUnit = CreateUnit( Player( pid ), uid, locX, locY, facing )
   endif
endfunction


Not sure which version you are refering to.. Copy used to copy all units an # amount of times.
So if you select 2 footmen and 3 riflemen and use "-copy 2". Each SELECTED unit would be copy twice.
So you will endup having 6 footmen and 9 riflemen (4 new footment and 6 new riflemen)

Code:
if SubString(s2s,0,5)=="-copy" and SubString(s2s,6,7)!="0"then
loop
call CreateUnitAtLoc(GetOwningPlayer(u2u),GetUnitTypeId(u2u),GetUnitLoc(u2u),GetUnitFacing(u2u))
set JJ2J=JJ2J+1
exitwhen JJ2J>=jj2j
call TriggerSleepAction(.001)
endloop
call RemoveLocation(GetUnitLoc(u2u))
endif
<-- This code was taken from FatherSpace's (Ken's) version of the update cheatpack back in who knows when... (cant remember the patch that broke most maps)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page Previous  1, 2, 3

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)