This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Borrowed from NAF. Might be plugged into DeepSets. | |
class SigmoidFlow(nn.Module): | |
def __init__(self,K): | |
super().__init__() | |
self.W = nn.Parameter(torch.FloatTensor(K,1)) | |
self.b = nn.Parameter(torch.FloatTensor(1,K)) | |
self.alpha = nn.Linear(1,K) | |
def forward(self,x): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <reference path="typings/ue.d.ts">/> | |
let _ = require('lodash') | |
function maybe_create_ai() { | |
let controller = GWorld.GetAllActorsOfClass(AIController).OutActors[0] | |
if (!controller) { | |
let BP = Blueprint.Load('/Game/TopDownBP/Blueprints/TopDownCharacter.TopDownCharacter') | |
let old = GWorld.GetAllActorsOfClass(Character).OutActors[0] | |
let pos = old.GetActorLocation() | |
let character = new BP.GeneratedClass(GWorld,{X:pos.X + 100,Y:pos.Y + 100,Z:pos.Z}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function maybe_create_ai() { | |
let controller = GWorld.GetAllActorsOfClass(AIController).OutActors[0] | |
if (!controller) { | |
let BP = Blueprint.Load('/Game/TopDownBP/Blueprints/TopDownCharacter.TopDownCharacter') | |
let old = GWorld.GetAllActorsOfClass(Character).OutActors[0] | |
let pos = old.GetActorLocation() | |
let character = new BP.GeneratedClass(GWorld,{X:pos.X,Y:pos.Y + 200,Z:pos.Z}) | |
controller = new AIController(GWorld) | |
controller.Possess(character) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createAvatar() { | |
let character = new Character(GWorld) | |
let controller = new AIController(GWorld) | |
controller.Possess(character) | |
let callback = null | |
controller.OnMoveCompleted = (req, result) => { | |
if (callback) { | |
callback(result) | |
callback = null | |
} |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
init_all_tables: /job:worker/replica:0/task:0/gpu:0 | |
init_2: /job:worker/replica:0/task:0/gpu:0 | |
group_deps: /job:worker/replica:0/task:0/gpu:0 | |
Const: /job:worker/replica:0/task:0/cpu:0 | |
report_uninitialized_variables/Shape: /job:worker/replica:0/task:0/cpu:0 | |
report_uninitialized_variables/strided_slice: /job:worker/replica:0/task:0/gpu:0 | |
report_uninitialized_variables/concat: /job:worker/replica:0/task:0/gpu:0 | |
report_uninitialized_variables/Reshape: /job:worker/replica:0/task:0/cpu:0 | |
save/Const: /job:worker/replica:0/task:0/cpu:0 | |
save/restore_slice_404: /job:worker/replica:0/task:0/cpu:0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GWorld.GetAllActorsOfClass(Light).OutActors.map(l => l.DestroyActor()) | |
function light(color) { | |
let actor = new PointLight(GWorld) | |
actor.LightComponent.SetMobility('Movable') | |
actor.LightComponent.Intensity = 1000 | |
actor.LightComponent.SetLightColor(color) | |
return actor | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log("Hello Github Gist") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let actor = null | |
function write(something) { | |
if (actor == null) { | |
actor = new TextRenderActor(GWorld, { X: 800, Z: 100 }, { Yaw: 180 }) | |
actor.TextRender.SetHorizontalAlignment('EHTA_Center') | |
} | |
actor.TextRender.K2_SetText(something) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Context.RunFile('aliases.js') | |
Context.RunFile('polyfill/unrealengine.js') | |
Context.RunFile('polyfill/timers.js') | |
function client() { | |
class MyTextRenderActor extends TextRenderActor { | |
ctor() { | |
this.AppComponent = ApplicationLifecycleComponent.CreateDefaultSubobject("Lifecycle") | |
this.AppComponent.ApplicationHasEnteredForegroundDelegate.Add(() => { | |
this.TextRender.SetText("App foreground") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UObject.prototype.ClearTimerbyFunctionName = UObject.prototype.K2_ClearTimer; | |
UObject.prototype.GetTimerElapsedTimebyFunctionName = UObject.prototype.K2_GetTimerElapsedTime; | |
UObject.prototype.GetTimerRemainingTimebyFunctionName = UObject.prototype.K2_GetTimerRemainingTime; | |
UObject.prototype.IsTimerActivebyFunctionName = UObject.prototype.K2_IsTimerActive; | |
UObject.prototype.IsTimerPausedbyFunctionName = UObject.prototype.K2_IsTimerPaused; | |
UObject.prototype.PauseTimerbyFunctionName = UObject.prototype.K2_PauseTimer; | |
UObject.prototype.SetTimerbyFunctionName = UObject.prototype.K2_SetTimer; | |
UObject.prototype.DoesTimerExistbyFunctionName = UObject.prototype.K2_TimerExists; | |
UObject.prototype.UnpauseTimerbyFunctionName = UObject.prototype.K2_UnPauseTimer; | |
UObject.prototype.ToString = UObject.prototype.Conv_ObjectToString; |
NewerOlder