HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

JASS Cinematic System Problem

09-24-2006, 01:26 AM#1
Ammorth
I'm having a problem with the CreateActor function. It doesn't seem to want to create any units.

I only made 1 modification to the script and that is:
Collapse JASS:
function AmmorthCheck takes nothing returns boolean
    if ( not ( udg_CinematicSystemOn == true ) ) then
        return false
    endif
    return true
endfunction

function CameraSystemInit takes nothing returns nothing
    local trigger t = CreateTrigger()
    call TriggerRegisterTimerEventPeriodic( t, CameraPeriod() )
    call TriggerAddCondition( t, Condition( function AmmorthCheck ) )
    call TriggerAddAction( t, function CameraMainLoop )
    set t = null

    call ApplyCameraInstantly( GetCurrentCameraSetup() )
endfunction
Adding a boolean condition to the camera system so I can disable it at need, as it locks the camera for normal game-play.

I tried both setting the variable with the script and creating the unit first and then setting it to a variable. Both do not work. Iv also tried normal units and the custom unit I want created, and nothing happens.

Trigger:
CinematicInit
Collapse Events
Map initialization
Conditions
Collapse Actions
Custom script: call InitCinematicSystem()
Custom script: call CreateActor(Player(1), 'e600')
Set actor[1] = (Last created unit)
Custom script: call CreateActor(Player(0), 'e600')
Set actor[2] = (Last created unit)
Custom script: set udg_actor[3] = CreateActor(Player(0), 'e600')
Custom script: set udg_actor[4] = CreateActor(Player(0), 'e600')
Custom script: set udg_actor[5] = CreateActor(Player(0), 'e600')
Custom script: set udg_actor[6] = CreateActor(Player(0), 'e600')
Custom script: set udg_actor[7] = CreateActor(Player(0), 'e600')
Custom script: set udg_actor[8] = CreateActor(Player(0), 'e600')
Custom script: set udg_actor[9] = CreateActor(Player(0), 'e600')
Custom script: set udg_actor[10] = CreateActor(Player(0), 'e600')
Custom script: set udg_actor[11] = CreateActor(Player(0), 'e600')
Set camera[1] = Scene1Cam1 <gen>
Cinematic - Turn cinematic mode On for (All players) over 0.00 seconds
Cinematic - Turn on letterbox mode (hide interface) for (All players): fade out over 0.00 seconds
Cinematic - Disable boundary tinting for (All players)
Environment - Set fog to style Exponential 2, z-start 1000.00, z-end 8000.00, density 1.00 and color (0.00%, 0.00%, 0.00%)
Custom script: call PlayScene(1)

Any help is appreciated.
09-24-2006, 04:19 PM#2
iNfraNe
are you absolutely sure you've got the rawcode right? in this case you wouldve create ALOT of nightelf custom units, since they start at 'e000'. Thats prolly where the problem lies.

Also,
Trigger:
Custom script: call CreateActor(Player(1), 'e600')
Set actor[1] = (Last created unit)
Will not work, since the bj_lastCreatedUnit isnt set in the CreateActor function.
09-24-2006, 04:30 PM#3
Ammorth
The custom unit is from the campaign custom objects. I tried a map custom object too, and it didn't want to create.

The unit code should be correct. I checked in both object editors (campaign and in-map), and by converting a trigger to custom text.

Quote:
Also,
Trigger:
Trigger:
Custom script: call CreateActor(Player(1), 'e600')
Set actor[1] = (Last created unit)
Will not work, since the bj_lastCreatedUnit isnt set in the CreateActor function.
Ahh, I see now. Ill check again, and see if I can get it to work. If not, its no biggy. I'm just creating the units with external functions and then doing the camera actions and calls inside.