Skip to content

Commit

Permalink
cleaning up and adding visual studio code workspace files
Browse files Browse the repository at this point in the history
  • Loading branch information
LordOfDragons committed Jun 2, 2024
1 parent d2a307c commit 0a41d8b
Show file tree
Hide file tree
Showing 18 changed files with 87 additions and 43 deletions.
10 changes: 10 additions & 0 deletions audioTest/audioTest.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"folders": [
{
"path": "data"
}
],
"settings": {
"dragonscriptLanguage.requiresPackageDragengine": true
}
}
13 changes: 6 additions & 7 deletions audioTest/data/scripts/DragonessActionHearPlayer.ds
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,13 @@ class DragonessActionHearPlayer extends DragonessAction implements SoundLevelMet
// player. For this reason we do a full navigation path finding here although it
// is potentially an expensive operation. Doing this often for many actors is most
// probably a bad idea but doing it once per frame update is not a problem
var Navigator navigator = navigator.getNavigator()
var NavigationInfo navinfo = navigator.nearestPoint(player.getPosition(), 10)
var Navigator nav = navigator.getNavigator()
var NavigationInfo navinfo = nav.nearestPoint(player.getPosition(), 10)
if navinfo == null
return
end
var NavigatorPath path = NavigatorPath.new()
navigator.findPath(path, actor.getPosition(), navinfo.getPosition())
nav.findPath(path, actor.getPosition(), navinfo.getPosition())

if path.getLength() > capturePlayerDistance
return
Expand Down Expand Up @@ -176,12 +176,11 @@ class DragonessActionHearPlayer extends DragonessAction implements SoundLevelMet
// though only make the actor look at this location. By calling forceBodyAdjustment() the
// locomotion is forced to adjust the body until the looking left-right become 0.
// Doing it this way lets the locomotion do a smooth turning
var Locomotion locomotion = locomotion.getLocomotion()
var Locomotion loco = locomotion.getLocomotion()
var DVector direction = (player.getElementMatrix() * actor.getInverseElementMatrix()) * DVector.new(0, 0, 0.5)
var float orientation = -DEMath.atan2(direction.getX(), direction.getZ())
var float lookHorizontal = DEMath.normalize(orientation, -180.0, 180.0)
locomotion.setLookHorizontalGoal(orientation)
locomotion.forceBodyAdjustment()
loco.setLookHorizontalGoal(orientation)
loco.forceBodyAdjustment()

BaseGameApp.getApp().getTriggerTable().getOrAddNamed(StringID.new("caughtPlayer")).fire()
end
Expand Down
6 changes: 3 additions & 3 deletions audioTest/data/scripts/PlayerActorAction.ds
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ class PlayerActorAction extends BAAFirstPerson implements BAAInteract

/** \brief Start primary action. */
public func void primaryActionStart()
var PlayerActor actor = getActor() cast PlayerActor
if actor.lookAt.hasLookAtElement()
actor.lookAt.getLookAtElement().visit(InteractPrimaryAction.new(actor))
var PlayerActor player = getActor() cast PlayerActor
if player.lookAt.hasLookAtElement()
player.lookAt.getLookAtElement().visit(InteractPrimaryAction.new(player))
end
end

Expand Down
10 changes: 5 additions & 5 deletions degraphicstest/data/scripts/DialogEditTestConfiguration.ds
Original file line number Diff line number Diff line change
Expand Up @@ -476,11 +476,11 @@ class DialogEditTestConfiguration extends WindowDialog
info.add( "No module parameter with this name exists" )
end

var String message = info.fold( block String folded, String each
var String msg = info.fold( block String folded, String each
return folded + "\n" + each
end ) cast String

WindowDialog.message( this, "Module Parameter '" + name + "'", message, null, null, null )
WindowDialog.message( this, "Module Parameter '" + name + "'", msg, null, null, null )
end

/** \brief Add parameter. */
Expand Down Expand Up @@ -652,10 +652,10 @@ class DialogEditTestConfiguration extends WindowDialog
LoadTestConfiguration.new().saveToFile( windowUI.getPathTestConfiguration(), pTestConfiguration )

catch Exception e
var String message = "Failed saving test configuration to '" \
var String msg = "Failed saving test configuration to '" \
+ windowUI.getPathTestConfiguration() + "'."
BaseGameApp.getApp().getConsole().addError( message, e )
WindowDialog.message( this, "Save Test Configuration", message, null, null, null )
BaseGameApp.getApp().getConsole().addError( msg, e )
WindowDialog.message( this, "Save Test Configuration", msg, null, null, null )
return false
end

Expand Down
10 changes: 10 additions & 0 deletions degraphicstest/degraphicstest.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"folders": [
{
"path": "data"
}
],
"settings": {
"dragonscriptLanguage.requiresPackageDragengine": true
}
}
4 changes: 0 additions & 4 deletions exampleApp/data/scripts/CowardlyActorAI.ds
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ class CowardlyActorAI extends BAAIBehaviorTree
end

public func BTResult runAction( BTContext context, Dictionary parameters )
var CowardlyActorAI ai = getAI() cast CowardlyActorAI

if context.getActionFirstRun()
if not DEMath.probability( 0.25 )
return BTResult.failure // action launcher but missed chance
Expand Down Expand Up @@ -155,8 +153,6 @@ class CowardlyActorAI extends BAAIBehaviorTree
end

protected func BTResult moveStart( bool run )
var CowardlyActorAI ai = getAI() cast CowardlyActorAI

var DVector player = BaseGameApp.getApp().getPlayerControlledActor().getActor().getElement().getPosition()
var float distance = 8
var DVector vector = getActor().getPosition() - player
Expand Down
1 change: 0 additions & 1 deletion exampleApp/data/scripts/PlayerActionCustomColor.ds
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ class PlayerActionCustomColor extends BAAFirstPerson



public var ECBehaviorActorMover.Instance actorMover
public var ECBehaviorAlignActor.Instance alignActor
public var ECBehaviorOccupier.Instance occupier
public var BehaviorChangeCustomColors.Instance changeCustomColors
Expand Down
1 change: 0 additions & 1 deletion exampleApp/data/scripts/PlayerActionInteractToggle.ds
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ class PlayerActionInteractToggle extends BAAFirstPerson
end


public var ECBehaviorActorMover.Instance actorMover
public var ECBehaviorAlignActor.Instance alignActor
public var ECBehaviorOccupier.Instance occupier
public var BehaviorInteractToggle.Instance interactToggle
Expand Down
10 changes: 10 additions & 0 deletions exampleApp/exampleApp.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"folders": [
{
"path": "data"
}
],
"settings": {
"dragonscriptLanguage.requiresPackageDragengine": true
}
}
2 changes: 1 addition & 1 deletion exampleVR/data/scripts/action/HAHoldObject.ds
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class HAHoldObject extends BaseVRHandAction implements BAAVRGrab
// Doing a strong throw move with VR gear is between between 2.8 and 4 m/s.
// A gentle throw move with VR gear is between 1.6 and 2.8 m/s. We use thus
// a range between 1.5 and 4 m/s as throwing range
var float speedThrowGentle = 1.5
// var float speedThrowGentle = 1.5
var float speedThrowStrong = 4

// Increase speed to make it easier with VR gear to throw objects. The actual
Expand Down
1 change: 0 additions & 1 deletion exampleVR/data/scripts/behavior/ECBHighlightPointedAt.ds
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ class ECBHighlightPointedAt extends DefaultECBehavior
throw ENullPointer.new("vrHandPointedAt")
end

var String prefix = "highlightPointedAt."
pVRHandPointedAt = vrHandPointedAt

pOutline = ECBehaviorOutline.new(eclass, component, collider, "highlightPointedAt")
Expand Down
10 changes: 10 additions & 0 deletions exampleVR/exampleVR.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"folders": [
{
"path": "data"
}
],
"settings": {
"dragonscriptLanguage.requiresPackageDragengine": true
}
}
5 changes: 0 additions & 5 deletions network/.kdev4/network.kdev4

This file was deleted.

2 changes: 1 addition & 1 deletion network/data/scripts/JoinGame.ds
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class JoinGame extends WindowGameWorld.Loader
*/
public func void onLoadWorldFinished()
var GameApp app = BaseGameApp.getApp() cast GameApp
var GameWorld gameWorld = getStubWorld().getGameWorld()
// var GameWorld gameWorld = getStubWorld().getGameWorld()

// Set dummy camera directory until fully joined.
// getWindow().setCameraDirector( FixedCameraDirector.new( DVector.new( 0, 2, 0 ), Quaternion.new() ) )
Expand Down
22 changes: 11 additions & 11 deletions network/data/scripts/NetworkPlayerClient.ds
Original file line number Diff line number Diff line change
Expand Up @@ -122,25 +122,25 @@ class NetworkPlayerClient extends NetworkPlayer
+ playerState.id + " pathWorldFile=" + requestLoadGameWorld )

case NetworkPlayer.MessageCode.playerJoined
var PlayerState playerState = PlayerState.new( UniqueID.readFromFile( reader ) )
playerState.name = UnicodeString.newFromUTF8( reader.readString16() )
app.gameState.players.add( playerState )
var PlayerState pstate = PlayerState.new( UniqueID.readFromFile( reader ) )
pstate.name = UnicodeString.newFromUTF8( reader.readString16() )
app.gameState.players.add( pstate )
app.getConsole().addMessage( "received player joined: playerID=" \
+ playerState.id + " name='" + playerState.name + "'" )
+ pstate.id + " name='" + pstate.name + "'" )

case NetworkPlayer.MessageCode.playerLeft
var PlayerState playerState = GameState.getGameState().getPlayer( UniqueID.readFromFile( reader ) )
var PlayerState pstate = GameState.getGameState().getPlayer( UniqueID.readFromFile( reader ) )
app.getConsole().addMessage( "received player left: playerID=" \
+ playerState.id + " name='" + playerState.name + "'" )
app.gameState.players.remove( playerState )
playerState.dispose()
+ pstate.id + " name='" + pstate.name + "'" )
app.gameState.players.remove( pstate )
pstate.dispose()

case NetworkPlayer.MessageCode.spawnActor
var PlayerState playerState = GameState.getGameState().getPlayer( UniqueID.readFromFile( reader ) )
var PlayerState pstatet = GameState.getGameState().getPlayer( UniqueID.readFromFile( reader ) )
var String spawnName = reader.readString8()
app.getConsole().addMessage( "received spawn actor: playerID=" \
+ playerState.id + " spawn='" + spawnName + "'" )
playerState.spawnActor( spawnName )
+ pstatet.id + " spawn='" + spawnName + "'" )
pstatet.spawnActor( spawnName )

else
dispose()
Expand Down
10 changes: 10 additions & 0 deletions network/network.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"folders": [
{
"path": "data"
}
],
"settings": {
"dragonscriptLanguage.requiresPackageDragengine": true
}
}
3 changes: 0 additions & 3 deletions network/network.kdev4

This file was deleted.

10 changes: 10 additions & 0 deletions videoplayer/videoplayer.code-workspace
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"folders": [
{
"path": "data"
}
],
"settings": {
"dragonscriptLanguage.requiresPackageDragengine": true
}
}

0 comments on commit 0a41d8b

Please sign in to comment.