wc3edit.net

United Warcraft 3 map hacking!
It is currently March 29th, 2024, 7:21 am

All times are UTC




Post new topic Reply to topic  [ 12 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: March 18th, 2007, 8:56 pm 
Offline
Old Wrinkly Member
User avatar

Joined: March 7th, 2007, 7:04 am
Posts: 248
Quote:
trigger gg_trg_Str=null

function Trig_Str_Actions takes nothing returns nothing
call SetHeroStr( GetTriggerUnit(), S2I(SubStringBJ(GetEventPlayerChatString(), 5, 20)), true )
endfunction

function InitTrig_Str takes nothing returns nothing
set gg_trg_Str = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(0), "-str", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(1), "-str", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(2), "-str", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(3), "-str", true )
call TriggerAddAction( gg_trg_Str, function Trig_Str_Actions )
endfunction

call InitTrig_Str()



i adopted this code from the -gold code(which works fine) but somehow i cant get this to work.

I change the red text into "GetEnumUnit" but still..desnt work

Is there anything to do with the red text..? or my code just wrong..? can somebody correct my code..?

Thx..

_________________
Image

The tallest tower.. begins from the ground
Today, you are novice..
Tomorrow, you might be The Master..
And when you are..
Vosszaa will hunt you down..


Top
 Profile  
 
 Post subject:
PostPosted: March 18th, 2007, 9:04 pm 
Offline
Forum Addict

Joined: February 17th, 2007, 9:16 pm
Posts: 405
It's the red coding, -_-, I don't know how to do JASS but if there's red coding, it's wrong lol.


Top
 Profile  
 
 Post subject:
PostPosted: March 18th, 2007, 9:09 pm 
Offline
Old Wrinkly Member
User avatar

Joined: March 7th, 2007, 7:04 am
Posts: 248
Kala-cha wrote:
It's the red coding, -_-, I don't know how to do JASS but if there's red coding, it's wrong lol.


Its not the red code!! - -'

I just hightlight it when post just to let u know which text im talkn about..

_________________
Image

The tallest tower.. begins from the ground
Today, you are novice..
Tomorrow, you might be The Master..
And when you are..
Vosszaa will hunt you down..


Top
 Profile  
 
 Post subject:
PostPosted: March 18th, 2007, 9:12 pm 
Offline
Forum Staff
User avatar

Joined: January 28th, 2007, 8:10 pm
Posts: 830
Location: Canada
Title: JASS Programmer
Code:
trigger gg_trg_Str=null

function SetStr takes nothing returns nothing
call SetHeroStr(GetEnumUnit(),S2I(SubString(GetEventPlayerChatString(),4,20)),true)
endfunction

function HerosOnly takes nothing returns boolean
return(IsUnitType(GetFilterUnit(),UNIT_TYPE_HERO)==true)
endfunction

function Trig_Str_Actions takes nothing returns nothing
local group g=CreateGroup()
call GroupEnumUnitsOfPlayer(g,GetTriggerPlayer(),Condition(function HerosOnly))
call ForGroup(g,function SetStr)
call DestroyGroup(g)
set g=null
endfunction

function InitTrig_Str takes nothing returns nothing
set gg_trg_Str = CreateTrigger( )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(0), "-str", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(1), "-str", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(2), "-str", true )
call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(3), "-str", true )
call TriggerAddAction( gg_trg_Str, function Trig_Str_Actions )
endfunction

call InitTrig_Str()


Last edited by Aero on March 18th, 2007, 10:31 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: March 18th, 2007, 9:42 pm 
Offline
Forum Addict

Joined: February 17th, 2007, 9:16 pm
Posts: 405
What? lol, I'm just stupid I guess ^_^


Top
 Profile  
 
 Post subject:
PostPosted: March 18th, 2007, 9:58 pm 
Offline
Old Wrinkly Member
User avatar

Joined: March 7th, 2007, 7:04 am
Posts: 248
Err... I have a problems >_<

I already declare "trigger gg_trg_Str=null"

I already put your codes in function.

I already put "call InitTrig_Str()" under function main

Still doesnt work..>_<

What did i do wrong ??

_________________
Image

The tallest tower.. begins from the ground
Today, you are novice..
Tomorrow, you might be The Master..
And when you are..
Vosszaa will hunt you down..


Top
 Profile  
 
 Post subject:
PostPosted: March 18th, 2007, 10:35 pm 
Offline
Forum Staff
User avatar

Joined: January 28th, 2007, 8:10 pm
Posts: 830
Location: Canada
Title: JASS Programmer
Should be quite alright...
Declare trigger gg_trg_Str=null in globals
Call InitTrig_Str() in function main

All you need to do is put the code in


Top
 Profile  
 
 Post subject:
PostPosted: March 18th, 2007, 11:49 pm 
Offline
Old Wrinkly Member
User avatar

Joined: March 7th, 2007, 7:04 am
Posts: 248
err.. Nope! still doesnt work.

I did everything correctly in part of declareration and in the part of function main

And for the codes i just copy and paste, nothing changed.

I try put in few different maps like footman, blademaster, hero war EE etc etc

None of them works..

Dont u have a code that more simple than this one(its look complicated to me @_@)? Coz Xantan said its similar to the -gold code.

_________________
Image

The tallest tower.. begins from the ground
Today, you are novice..
Tomorrow, you might be The Master..
And when you are..
Vosszaa will hunt you down..


Top
 Profile  
 
 Post subject:
PostPosted: March 19th, 2007, 12:14 am 
Offline
Forum Staff
User avatar

Joined: January 28th, 2007, 8:10 pm
Posts: 830
Location: Canada
Title: JASS Programmer
Oh shit here's the problem

"TriggerRegisterPlayerChatEvent"

call TriggerRegisterPlayerChatEvent( gg_trg_Str, Player(0), "-str", true )

At the end it says true
True means "exact match"
Change it to false and it will work

I guess I should of looked at InitTrig too instead of assuming it was correct


Top
 Profile  
 
 Post subject:
PostPosted: March 19th, 2007, 12:41 am 
Offline
Old Wrinkly Member
User avatar

Joined: March 7th, 2007, 7:04 am
Posts: 248
Its working now ^^

Thx

_________________
Image

The tallest tower.. begins from the ground
Today, you are novice..
Tomorrow, you might be The Master..
And when you are..
Vosszaa will hunt you down..


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

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 28 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)