- Joined
- Jul 10, 2007
- Messages
- 6,306
This needs updating. MFN is being updated big time atm with a lot of new features, so this will have to be changed for the updates. This will also including a few other interesting things that the new MFN allows you to do : ), including locking a unit to a player's screen rather than locking a player to a unit's screen : O. What does that allow? Arrow movements with 0 delay ^_^.
a simple locked screen utility for MFN.
Requires MFN v.01e CN15
This is v.01a CN2 ftw
Got rid of UPN call : O, lol.... i had it in there to make things easier to read and what not, but i forgot it was in there : O.
it works 100% and is very easy to use ^_^
default interval (how often it locks the screen) is 3.
It uses memory addresses for the units... so uhm...
yea... ;p
or.. if you get the spiffy UPN utility, which isn't out yet, you can just do this
Description-
Locks a player's screen to a unit : )
LSN-
LSN Diagnostics (normally disabled)-
Usage Example-
In your MFN Interface, just put this in your utility area
turn on locked by using the turnOn method
turn off by using turnOff method
add players/units by using addPlayer method : P
*Note* takes a memory address atm using virtual memory from MFN
remove a player with remove
change interval to w/e with interval
*Note* Interval is how often it locks the screen
There's a reason to keep the two if statements separate btw... : o
a simple locked screen utility for MFN.
Requires MFN v.01e CN15
This is v.01a CN2 ftw
Got rid of UPN call : O, lol.... i had it in there to make things easier to read and what not, but i forgot it was in there : O.
it works 100% and is very easy to use ^_^
default interval (how often it locks the screen) is 3.
It uses memory addresses for the units... so uhm...
JASS:
local integer unit = MFN.createVariable()
MFN.setVariable(unit, MFN_U2I(CreateUnit(blah blah)))
yea... ;p
or.. if you get the spiffy UPN utility, which isn't out yet, you can just do this
JASS:
set integer unit = UPN.createUnit(player, unittype, x, y, facing)
Description-
Locks a player's screen to a unit : )
LSN-
JASS:
scope LSjijahHG
private keyword LSNStructure
globals
LSNStructure LSN
endglobals
private struct LSNStructure
private static string SYSTEM = "LSN"
private static string VERSION = ".01a"
private static integer CN = 1
private trigger run = CreateTrigger()
private integer array unit[11]
private real interval = .1
private method require takes nothing returns nothing
call MFN.requireSystem("MFN", 15)
endmethod
public method turnOff takes nothing returns nothing
local integer x = 0
call DisableTrigger(.run)
loop
if (.unit[x] != -1) then
if (GetLocalPlayer() == MFN.getPlayer(x)) then
call ResetToGameCamera(0)
endif
endif
set x = x + 1
exitwhen x > MFN.players
endloop
endmethod
public method turnOn takes nothing returns nothing
call EnableTrigger(.run)
endmethod
public static method lock takes nothing returns nothing
local integer x = 0
local player p
loop
set p = MFN.getPlayer(MFN.playerID[x])
if (LSN.unit[x] != -1) then
if (GetLocalPlayer() == p) then
call SetCameraTargetController(MFN_I2Unit(MFN.getVariableValue(LSN.unit[x])), 0, 0, false)
endif
endif
set x = x + 1
exitwhen x > MFN.players
endloop
endmethod
public method addPlayer takes player p, integer u returns nothing
set .unit[MFN.getPlayerID(p)] = u
endmethod
public method removePlayer takes player p returns nothing
set .unit[MFN.getPlayerID(p)] = -1
endmethod
public method setInterval takes real interval returns nothing
set .interval = interval
call DestroyTrigger(.run)
set .run = null
set .run = CreateTrigger()
call DisableTrigger(.run)
call TriggerRegisterTimerEvent(.run, .interval, true)
call TriggerAddAction(LSN.run, function LSNStructure.lock)
endmethod
public static method create takes nothing returns LSNStructure
set LSN = LSNStructure.allocate()
call DisableTrigger(LSN.run)
call TriggerRegisterTimerEvent(LSN.run, LSN.interval, true)
call TriggerAddAction(LSN.run, function LSNStructure.lock)
call MFN.registerSystem(LSN.SYSTEM, LSN.CN)
call LSN.require()
call createCreditMFN(LSN.SYSTEM, LSN.VERSION, "Nestharus", "None", "ReplaceableTextures\\CommandButtons\\BTNPeriapt1.blp", "Locked Screen Utility v"+ LSN.VERSION + " CN " + I2S(LSN.CN))
return 0
endmethod
endstruct
endscope
LSN Diagnostics (normally disabled)-
JASS:
scope LSjijahHG
private keyword LSNStructure
globals
LSNStructure LSN
endglobals
private struct LSNStructure
private static string SYSTEM = "LSN"
private static string VERSION = ".01a"
private static integer CN = 1
public method require takes nothing returns nothing
call MFN.requireSystem("MFN", 15)
endmethod
public static method create takes real interval returns LSNStructure
set LSN = LSNStructure.allocate()
call MFN.registerSystem(LSN.SYSTEM, LSN.CN)
call LSN.require()
set MFN.diagonstics = true
return 0
endmethod
endstruct
endscope
Usage Example-
In your MFN Interface, just put this in your utility area
JASS:
public function utilityINI takes nothing returns nothing
call LSN.create()
endfunction
turn on locked by using the turnOn method
JASS:
LSN.turnOn()
turn off by using turnOff method
JASS:
LSN.turnOff()
add players/units by using addPlayer method : P
*Note* takes a memory address atm using virtual memory from MFN
JASS:
LSN.addPlayer(Player(0), 30)
remove a player with remove
JASS:
LSN.removePlayer(Player(0))
change interval to w/e with interval
*Note* Interval is how often it locks the screen
JASS:
LSN.setInterval(2)
There's a reason to keep the two if statements separate btw... : o
Attachments
Last edited: