tooltiperror
Super Moderator
- Reaction score
- 231
Is there a constant player variable for player one?
Have you tried and tested that?A constant would return Player(0) in vjass from inlining, so like
[ljass]DisplayTestToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(PLAYER_ONE))[/ljass]
would be like
[ljass]DisplayTestToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(Player(0)))[/ljass]
rather than using the variable
Have you tried and tested that?
globals
constant player playerOne = Player(0)
endglobals
function RAWR takes nothing returns nothing
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(playerOne))
endfunction
//===========================================================================
// Trigger: Untitled Trigger 001
//===========================================================================
//TESH.scrollpos=0
//TESH.alwaysfold=0
function RAWR takes nothing returns nothing
call DisplayTextToPlayer(GetLocalPlayer(), 0, 0, GetPlayerName(playerOne))
endfunction//===========================================================================
function InitCustomTriggers takes nothing returns nothing
call InitTrig_StrSteal()
//Function not found: call InitTrig_Untitled_Trigger_001()
endfunction
Personally I even doubt that that's true. I'd assume this would work just fine:I don't believe you can initialize players in the globals block
You can in fact initialize players in globals block ^.^. I do it all the time.But have not tried it myself.
Nestharus, as far as I'm concerned, it was never true. I don't have any evidence that there was ever a bug in JassHelper about inlining constant handles (but perhaps there was), but you've been repeating it for the last year or so. I just wanted to know if you actually had any evidence or if you were just repeating unfounded misinformation again.
But i have read that wc3mapoptimizer inlines all constants, regardless it's an handle or not (never tested, simply because never used it)
- Added "Inline constant globals" method.
Can we have this tested?But i have read that wc3mapoptimizer inlines all constants, regardless it's an handle or not (never tested, simply because never used it)
I'll give it a shot.Can we have this tested?
scope InlineTest
globals
constant real Real = 3.0
constant integer Integer = 3
constant string String = "Three"
constant boolean Boolean = false
constant player PLAYER = Player(0)
constant unit UNIT = CreateUnit(Player(0),039;hfoo039;,0,0,0)
constant unit UNIT_TEST_ABOVE = CreateUnit(PLAYER,Integer,Real,Real,Real)
constant unit UNIT_WEIRD = bj_lastCreatedUnit
endglobals
function TheGoodTheBadAndTheUgly_IsTheGreatestFilmEver takes nothing returns nothing
local real r = Real
local integer i = Integer
local string s = String
local boolean b = Boolean
local player p = PLAYER
local unit u = UNIT
local unit uta = UNIT_TEST_ABOVE
local unit uw = UNIT_WEIRD
endfunction
endscope
globals
constant player e=Player(0)
constant unit x=CreateUnit(Player(0),039;hfoo039;,0,0,0)
constant unit o=CreateUnit(e,3,3.,3.,3.)
constant unit a=bj_lastCreatedUnit
real E=.0
real X=.0
boolexpr I=null
endglobals