wc3edit.net

United Warcraft 3 map hacking!
It is currently July 8th, 2020, 11:07 am

All times are UTC




Post new topic Reply to topic  [ 39 posts ]  Go to page 1, 2, 3, 4  Next
Author Message
 Post subject: Custom Commands for maps
PostPosted: February 26th, 2020, 4:43 am 
Offline
Junior Member

Joined: January 14th, 2019, 8:32 pm
Posts: 32
Lets say for example with dark deeds how there's a 1 in 10 chance at random you will be the evil one. How would i enter a command automatically making me the one it chooses?


Top
 Profile  
 
PostPosted: February 26th, 2020, 4:48 am 
Offline
Old Wrinkly Member
User avatar

Joined: December 17th, 2011, 9:25 am
Posts: 206
Title: Genius
This question should in this not Tech Support

Also for your question resolve its
Get the conditional => Add new command => If ... else => done


Top
 Profile  
 
PostPosted: February 26th, 2020, 5:47 am 
Offline
Junior Member

Joined: January 14th, 2019, 8:32 pm
Posts: 32
clanhinata wrote:
This question should in this not Tech Support

Also for your question resolve its
Get the conditional => Add new command => If ... else => done


apologies for wrong post, though I have no idea what you said about resolving it I need something more detailed


Top
 Profile  
 
PostPosted: February 26th, 2020, 9:28 am 
Offline
Old Wrinkly Member
User avatar

Joined: December 17th, 2011, 9:25 am
Posts: 206
Title: Genius
You need alternative the random function , either with conditional function or conditional if
So you need create a command with a variable to modify it

Attachment:
easysolve.png


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
PostPosted: February 26th, 2020, 6:09 pm 
Offline
Also Not an Admin, but closer than devoltz
User avatar

Joined: February 14th, 2018, 5:35 am
Posts: 1402
Title: Just Another S.Mod
I would need the map to make a good example for you, but what clanhinata said is right.


Top
 Profile  
 
PostPosted: February 26th, 2020, 10:22 pm 
Offline
Junior Member

Joined: January 14th, 2019, 8:32 pm
Posts: 32
nuzamacuxe wrote:
I would need the map to make a good example for you, but what clanhinata said is right.
I understand the concept but i dont know what to type or where to put the command at. I have attached the the file if you wanted a better understanding. I appreciate all the help.


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
PostPosted: February 26th, 2020, 10:24 pm 
Offline
Junior Member

Joined: January 14th, 2019, 8:32 pm
Posts: 32
That and the evil hero is also random, is it the same concept to get the evil you want?


Top
 Profile  
 
PostPosted: February 27th, 2020, 9:37 pm 
Offline
Also Not an Admin, but closer than devoltz
User avatar

Joined: February 14th, 2018, 5:35 am
Posts: 1402
Title: Just Another S.Mod
Just compare both war3map.j. What I did was simply increase your chance of being The Evil One to 100 as soon as you type the command "-wevil". That way you will be always the choosen one.

Code:
function ChatEvent takes trigger Trig, string Text, boolean Bool, code Act returns trigger
local integer index=0
loop
  call TriggerRegisterPlayerChatEvent(Trig,Player(index),Text,Bool)
  set index=index+1
  exitwhen index==bj_MAX_PLAYER_SLOTS
endloop
if Act!=null then
   call TriggerAddAction(Trig,Act)
endif
return Trig
endfunction
function CC_Commands takes nothing returns nothing
local integer PID = GetPlayerId( GetTriggerPlayer( ) )
local string Text = SubString( GetEventPlayerChatString(), 1, StringLength(GetEventPlayerChatString()) )

if Text == "wevil" then
   set fz[ PID ]= 100
   set f6[ PID ]= true
   call DisplayTimedTextToPlayer( Player( PID ), 0, 0, 10, "You will be The Evil One." )
endif

endfunction
function CC_Init takes nothing returns nothing
call ChatEvent( CreateTrigger( ), "-", false, function CC_Commands )
endfunction


The evil hero isn't the same way.


You do not have the required permissions to view the files attached to this post.


Top
 Profile  
 
PostPosted: February 28th, 2020, 5:24 am 
Offline
Junior Member

Joined: January 14th, 2019, 8:32 pm
Posts: 32
nuzamacuxe wrote:
Just compare both war3map.j. What I did was simply increase your chance of being The Evil One to 100 as soon as you type the command "-wevil". That way you will be always the choosen one.

Code:
function ChatEvent takes trigger Trig, string Text, boolean Bool, code Act returns trigger
local integer index=0
loop
  call TriggerRegisterPlayerChatEvent(Trig,Player(index),Text,Bool)
  set index=index+1
  exitwhen index==bj_MAX_PLAYER_SLOTS
endloop
if Act!=null then
   call TriggerAddAction(Trig,Act)
endif
return Trig
endfunction
function CC_Commands takes nothing returns nothing
local integer PID = GetPlayerId( GetTriggerPlayer( ) )
local string Text = SubString( GetEventPlayerChatString(), 1, StringLength(GetEventPlayerChatString()) )

if Text == "wevil" then
   set fz[ PID ]= 100
   set f6[ PID ]= true
   call DisplayTimedTextToPlayer( Player( PID ), 0, 0, 10, "You will be The Evil One." )
endif

endfunction
function CC_Init takes nothing returns nothing
call ChatEvent( CreateTrigger( ), "-", false, function CC_Commands )
endfunction


The evil hero isn't the same way.

Thank you! how would a pick command work for this? say pick pitlord for example?


Top
 Profile  
 
PostPosted: February 28th, 2020, 5:33 am 
Offline
Junior Member

Joined: January 14th, 2019, 8:32 pm
Posts: 32
Auregon wrote:
nuzamacuxe wrote:
Just compare both war3map.j. What I did was simply increase your chance of being The Evil One to 100 as soon as you type the command "-wevil". That way you will be always the choosen one.

Code:
function ChatEvent takes trigger Trig, string Text, boolean Bool, code Act returns trigger
local integer index=0
loop
  call TriggerRegisterPlayerChatEvent(Trig,Player(index),Text,Bool)
  set index=index+1
  exitwhen index==bj_MAX_PLAYER_SLOTS
endloop
if Act!=null then
   call TriggerAddAction(Trig,Act)
endif
return Trig
endfunction
function CC_Commands takes nothing returns nothing
local integer PID = GetPlayerId( GetTriggerPlayer( ) )
local string Text = SubString( GetEventPlayerChatString(), 1, StringLength(GetEventPlayerChatString()) )

if Text == "wevil" then
   set fz[ PID ]= 100
   set f6[ PID ]= true
   call DisplayTimedTextToPlayer( Player( PID ), 0, 0, 10, "You will be The Evil One." )
endif

endfunction
function CC_Init takes nothing returns nothing
call ChatEvent( CreateTrigger( ), "-", false, function CC_Commands )
endfunction


The evil hero isn't the same way.

Thank you! how would a pick command work for this? say pick pitlord for example?


also where did you place this for future reference?


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


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:  
cron
Powered by phpBB® Forum Software © phpBB Group

phpBB SEO


Privacy Policy Statement
Impressum (German)