Jass Questions.

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Jass Questions.

Post by weirdone2 »

As far as I can see it's use would be that you can use it in loops with custom units since ter usually grouped close together. And if you use it in this form the map will b bigger but the game will b faster so your choice their, though it would only really b noticeable if you were doing lots of stuff with units.
HINDYhat
Senior Member
Posts: 101
Joined: June 1st, 2007, 9:05 pm

Re: Jass Questions.

Post by HINDYhat »

Alternatively, you can do this:

Code: Select all

S2I( UnitId2String( 'h000' ) )
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Jass Questions.

Post by Aero »

There's a much better more practical use.

String2Rawcode and Rawcode2String (Custom functions...Don't ask me for these . . .)
HINDYhat
Senior Member
Posts: 101
Joined: June 1st, 2007, 9:05 pm

Re: Jass Questions.

Post by HINDYhat »

Lawl, is it just ASCII conversion? Isn't that what the single quotes do for you?

And I can't see how it could be more practical, since you wouldn't even be running String2Rawcode or vice-versa in-game... Those are just to get the integer Id's, right? Because if you are running it in-game, it sort of eliminates the purpose of not using ASCII unit Id's...
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Jass Questions.

Post by Aero »

It's probably the best method of hiding passwords or admin commands if used correctly.

Other than for that, it's almost useless.
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Jass Questions.

Post by weirdone2 »

Jass Questions Revive!! Dun Da DaDun.

I'm wondering if theirs any better way of doing what i've done with these codes.

For this first one I'm going to just make the force one a global since I'm running into them everywhere.
Spoiler:
[/code]
function Trig_Visibility_Func001A takes nothing returns nothing
call CreateFogModifierRectBJ(true,GetEnumPlayer(),FOG_OF_WAR_VISIBLE,gg_rct_City)
endfunction
function Trig_Visibility_Func002A takes nothing returns nothing
call CreateFogModifierRectBJ(true,GetEnumPlayer(),FOG_OF_WAR_VISIBLE,gg_rct_Orc_City2)
endfunction
function Trig_Visibility_Func003A takes nothing returns nothing
call SetUnitInvulnerable(GetEnumUnit(),true)
endfunction
function Trig_Visibility_Func004A takes nothing returns nothing
call SetUnitInvulnerable(GetEnumUnit(),true)
endfunction
function Trig_Visibility_Actions takes nothing returns nothing
local force f1=CreateForce()
local force f2=CreateForce()
local group g1=CreateGroup()
local group g2=CreateGroup()
call ForceEnumAllies(f1,Player(0),null)
call ForceEnumAllies(f2,Player(1),null)
call GroupEnumUnitsInRect(g1,gg_rct_Human_Select,null)
call GroupEnumUnitsInRect(g2,gg_rct_Orc_Select,null)
call ForForce(f1,function Trig_Visibility_Func001A)
call ForForce(f2,function Trig_Visibility_Func002A)
call ForGroup(g1,function Trig_Visibility_Func003A)
call ForGroup(g2,function Trig_Visibility_Func004A)
set f1=null
set f2=null
set g1=null
set g2=null
endfunction
[/code]
For this next one ters hundres of the get all players so I'm thinking about maybe doing a loop function with a code call or something or is what it at already better then a looped display to player? o.0
Spoiler:
[/code]
function Trig_Leave_Human_Actions takes nothing returns nothing
call DisplayTextToForce(bj_FORCE_ALL_PLAYERS,("|cffff0000" +(GetPlayerName(GetTriggerPlayer())+" of the Humans has left the Game!!|r" )))
call ForForce(fhumans,function Trig_Leave_Human_Func002A)
endfunction
[/code]
Any better way of doing this one? Ignore the create trigger part I'm going to move all that crap later on mainly just wondering if the region part is good.
Spoiler:
[/code]
function InitTrig_Average_Human takes nothing returns nothing
local region rg=CreateRegion()
call RegionAddRect(rg,gg_rct_Human_City)
set gg_trg_Average_Human = CreateTrigger()
call TriggerRegisterEnterRegion(gg_trg_Average_Human,rg,null)
call TriggerAddCondition(gg_trg_Average_Human,Condition(function Trig_Average_Human_Conditions))
call TriggerAddAction(gg_trg_Average_Human,function Trig_Average_Human_Actions)
set rg=null
endfunction
[/code]
When using bj_ghoul for long term use what index should it be set on to be safe from change?
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Jass Questions.

Post by Aero »

Q: I'm wondering if theirs any better way of doing what i've done with these codes.?
A: Yes.

#1:
Spoiler:

Code: Select all

function GrantVisionTeam1 takes nothing returns nothing
call FogModifierStart(CreateFogModifierRect(GetEnumPlayer(),FOG_OF_WAR_VISIBLE,gg_rct_City,true,false))
endfunction
function GrantVisionTeam2 takes nothing returns nothing
call FogModifierStart(CreateFogModifierRect(GetEnumPlayer(),FOG_OF_WAR_VISIBLE,gg_rct_Orc_City2,true,false))
endfunction
function SetUnitsInvulnerable takes nothing returns nothing
call SetUnitInvulnerable(GetEnumUnit(),true)
endfunction
function Trig_Visibility_Actions takes nothing returns nothing
local force f=CreateForce()
local group g=CreateGroup()
call ForceEnumAllies(f,Player(0),null)
call ForForce(f,function GrantVisionTeam1)
call ForceEnumAllies(f,Player(1),null)
call ForForce(f,function GrantVisionTeam2)
call GroupEnumUnitsInRect(g,gg_rct_Human_Select,null)
call ForGroup(g,function SetUnitsInvulnerable)
call GroupEnumUnitsInRect(g,gg_rct_Orc_Select,null)
call ForGroup(g,function SetUnitsInvulnerable)
call DestroyGroup(g)
call DestroyForce(f)
set f=null
set g=null
endfunction
#2: This will display text to all players:
Spoiler:

Code: Select all

call DisplayTextToPlayer(GetLocalPlayer(),0,0,"|cffff0000"+GetPlayerName(GetTriggerPlayer())+" of the Humans has left the Game!!")
Q:Any better way of doing this one? Ignore the create trigger part I'm going to move all that crap later on mainly just wondering if the region part is good?
A:What you have is correct.

Q:When using bj_ghoul for long term use what index should it be set on to be safe from change?
A:100-8191

Please start a new thread for each problem. Makes things easier.
initialD
Some Honorary Title
Posts: 1713
Joined: June 8th, 2007, 5:08 am
Title: Angry Bird

Re: Jass Questions.

Post by initialD »

Aero, if an enemy player share vision with me. Does it share to my teammates as well?
I remembered Xantan's pack has a -vision command.
It's kinda annoying because vision is shared to everyone on the same team.
User avatar
Aero
Forum Staff
Posts: 829
Joined: January 28th, 2007, 8:10 pm
Title: JASS Programmer
Location: Canada

Re: Jass Questions.

Post by Aero »

If an enemy is sharing vision with you, only you can see the enemy.
Just because you have shared vision with allies, doesn't mean they can see everything you can see.
Just means they can see what your units can see.
User avatar
weirdone2
Forum Staff
Posts: 926
Joined: June 3rd, 2007, 8:03 pm

Re: Jass Questions.

Post by weirdone2 »

K thanks for the info aero, and sorry didn't know all the questions in the same thread was hard on the reading. :(