I played someone else's Mod not too long ago and sent them a PM about how I was able to walk around in the dark after going through their Portal. It was kinda fun actually; thought it was another puzzleEleven Warrior wrote:Hi all I don't know if anyone else has found this but it's very funny. When you walk through the Portal it will take you to the Script Entity Location.
Thxs to Issac for helping me with this script, although the move bit is strange and was hoping AH would be able to help out here.
1 - Put this code into script entity name does not matter. place in it one square of your choice (NOT WALL) floor.
2 - Put a portal on the map named: portal_1.
3 - Walk through the portal, when the fade finishes, press the ( h ) key and move in any direction. Now we are on the Moon walking Slow Mo lol.
Code: Select all
portal_1:removeComponent("portal") portal_1:createComponent("Portal") :addConnector("onArrival", self.go.id, "arrivalHook"); function arrivalHook() party:setPosition(self.go.x, self.go.y, self.go.facing, self.go.elevation, self.go.level) GameMode.fadeIn(0xffffff,1) --Fade in from white, over a 1 second duration. GameMode.setGameFlag("DisableMovement",false) --added this Issac lol-- end
portal like teleport
Re: portal like teleport
- Eleven Warrior
- Posts: 736
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: portal like teleport
Mr Issac. Ok mate i'll try that solution, sounds good to me It's a shame that AH did not make the portal do a simular thing as the teleporter, but all good
Re: portal like teleport
We'll see if we get a developer comment; it might be a bug, or already have a solution that none of us know about. The only snag with my solution is that the portal occupies a cell, and no longer behaves like a doorway.Eleven Warrior wrote:Mr Issac. Ok mate i'll try that solution, sounds good to me It's a shame that AH did not make the portal do a simular thing as the teleporter, but all good
- Eleven Warrior
- Posts: 736
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: portal like teleport
Bump: Err Shit Ah helppppppppppppppppppppppppppppppppppp
Re: portal like teleport
Sorry guys i'm out of business for some days more.
In meanwile, since seems portal has his own camera, is there a way to move/control it?
TY
In meanwile, since seems portal has his own camera, is there a way to move/control it?
TY
- AndakRainor
- Posts: 674
- Joined: Thu Nov 20, 2014 5:18 pm
Re: portal like teleport
Hey! With Minmay's findings here, the portal problems are over.
Here is my teleportal object:
Here is my teleportal object:
Code: Select all
defineObject{
name = "teleportal",
components = {
{
class = "Model",
name = "frame",
model = "assets/models/env/portal_frame.fbx",
staticShadow = true,
},
{
class = "Portal",
onArrival = function(self)
local dest = self.go.script:get(self.go.script:get("destination") or 1) or {x=0,y=0,e=0,l=0}
party:setPosition(dest.x, dest.y, party.facing, dest.e, dest.l)
GameMode.fadeIn(0xffffff,1)
GameMode.setEnableControls(true)
--print("time multiplier value was "..GameMode.getTimeMultiplier())
GameMode.setTimeMultiplier(1)
end,
},
{
class = "Light",
offset = vec(0, 1, 0),
type = "point",
color = vec(0.9, 1.0, 1.3),
brightness = 12,
range = 6,
castShadow = true,
onUpdate = function(self)
local noise = math.noise(Time.currentTime()*1 + 123) * 0.5 + 0.9
self:setBrightness(noise * 15)
end,
},
{
class = "Particle",
particleSystem = "portal_particles",
emitterMesh = "assets/models/env/portal_rim_emitter.fbx",
},
{
class = "Particle",
name = "particle2",
particleSystem = "portal_particles_radial",
emitterMesh = "assets/models/env/portal_radial_emitter.fbx",
},
{
class = "Model",
name = "portalBeam",
model = "assets/models/env/portal_beam.fbx",
},
{
class = "Model",
name = "planeModel",
model = "assets/models/env/portal_plane.fbx",
},
{
class = "Script",
source = [[
data = {{x=0,y=0,e=0,l=0},{x=0,y=0,e=0,l=0}}
function dest1() self.data["destination"] = 1 end
function dest2() self.data["destination"] = 2 end
function get(self,name) return self.data[name] end
function set(self,name,value) self.data[name] = value end
]],
},
{
class = "ScriptController",
name = "controller",
},
},
placement = "wall",
tags = { "door" },
editorIcon = 124,
automapIcon = 84,
}
- Eleven Warrior
- Posts: 736
- Joined: Thu Apr 18, 2013 2:32 pm
- Location: Australia
Re: portal like teleport
Well I say...... Bloody good job mate and thxs for this
Re: portal like teleport
can someone explain to me, what i have to fill into the script to get it working. I cant seem to get it to work for me?AndakRainor wrote: ↑Sat Mar 19, 2016 8:58 pm Hey! With Minmay's findings here, the portal problems are over.
Here is my teleportal object:Code: Select all
defineObject{ name = "teleportal", components = { { class = "Model", name = "frame", model = "assets/models/env/portal_frame.fbx", staticShadow = true, }, { class = "Portal", onArrival = function(self) local dest = self.go.script:get(self.go.script:get("destination") or 1) or {x=0,y=0,e=0,l=0} party:setPosition(dest.x, dest.y, party.facing, dest.e, dest.l) GameMode.fadeIn(0xffffff,1) GameMode.setEnableControls(true) --print("time multiplier value was "..GameMode.getTimeMultiplier()) GameMode.setTimeMultiplier(1) end, }, { class = "Light", offset = vec(0, 1, 0), type = "point", color = vec(0.9, 1.0, 1.3), brightness = 12, range = 6, castShadow = true, onUpdate = function(self) local noise = math.noise(Time.currentTime()*1 + 123) * 0.5 + 0.9 self:setBrightness(noise * 15) end, }, { class = "Particle", particleSystem = "portal_particles", emitterMesh = "assets/models/env/portal_rim_emitter.fbx", }, { class = "Particle", name = "particle2", particleSystem = "portal_particles_radial", emitterMesh = "assets/models/env/portal_radial_emitter.fbx", }, { class = "Model", name = "portalBeam", model = "assets/models/env/portal_beam.fbx", }, { class = "Model", name = "planeModel", model = "assets/models/env/portal_plane.fbx", }, { class = "Script", source = [[ data = {{x=0,y=0,e=0,l=0},{x=0,y=0,e=0,l=0}} function dest1() self.data["destination"] = 1 end function dest2() self.data["destination"] = 2 end function get(self,name) return self.data[name] end function set(self,name,value) self.data[name] = value end ]], }, { class = "ScriptController", name = "controller", }, }, placement = "wall", tags = { "door" }, editorIcon = 124, automapIcon = 84, }
data = {{x=0,y=0,e=0,l=0},{x=0,y=0,e=0,l=0}}
function dest1() self.data["destination"] = 1 end
function dest2() self.data["destination"] = 2 end
function get(self,name) return self.data[name] end
function set(self,name,value) self.data[name] = value end