qolelis on 7/1/2009 at 16:21
Quote Posted by LarryG
Suggestions for scripts:
* Change Ambiant Lighting (RGB / HSL)
* Change Fog
* Change Rain/Snow
That would allow for some cool effects! It would not matter that the change is global, since the player is always local. With appropriate traps to change back, it could
appear to be local.
Changing the ambient light + the sky could be used for simulating night/day transitions. Imagine The City getting darker and people going home leaving the streets empty and then a guard comes lighting the street lamps one after the other. That could make for some nice visuals.
Nameless Voice on 7/1/2009 at 16:35
Quote Posted by LarryG
Suggestions for scripts:
* Change Ambiant Lighting (RGB / HSL)
* Change Fog
* Change Rain/Snow
That would allow for some cool effects! It would not matter that the change is global, since the player is always local. With appropriate traps to change back, it could
appear to be local.
I don't think any of these are possible.
Yandros on 7/1/2009 at 18:34
Quote Posted by LarryG
You can't change the ambiant light levels mid-game can you? There is no script that works at that level is there?
Quote Posted by Yandros
No. Also you can't change fog colour or distance, or precip type (rain vs snow).
:p
LarryG on 7/1/2009 at 19:00
Not possible currently. But could it be possible with a script? Could a script reach into and change those variables? It might be worth looking at to see if it could be done.
LarryG on 7/1/2009 at 19:13
Here's another "out of the box" idea for a script prompted by some of the current threads: What about a script that allowed you to switch which directory is used for textures. The texture names would not be changed on the brushes, but the place that the texture was read from would change. This would allow switching, in-mission, between grey-scale and colored textures without having to duplicate geometry, only textures. It would also allow a host of other effects. Maybe tune it by family, so that only textures in family A get switched to family A'. That kind of thing.
Again I have no idea if it is possible, but wouldn't it be cool if ...
Nameless Voice on 7/1/2009 at 19:21
That sort of thing goes beyond the scope of scripts and into the realm of directly hacking DromEd, e.g. modifying its running memory.
It would theoretically be possible, but it would be very difficult and is beyond my ability.
Scripts are really only concerned about objects, rather than the mission itself (brushes, rendering parameters, etc.).
LarryG on 7/1/2009 at 19:26
It would help my thinking if I understood more about the limitations inherent in scripts. What are the general classes of things that can be done? Clearly events can be generated and responded to, but what is the scope of responses that can be made? What actually is exposed in the engine?
ZylonBane on 7/1/2009 at 19:33
Scripts don't have access to texture memory, do they? I've occasionally wondered if it would be possible to implement Unreal-style algorithmic textures via custom scripts.
Nameless Voice on 7/1/2009 at 19:39
This is not a complete list, but it's a rough list of the main services that Dark exposes to scripts. Taken from lg.h, which you can get from the source for Telliamed's scripts. Or from the soure for NVScript, if I'd ever actually got around to releasing any. Oops.
Some services, such as IShockGameSrv, are only available in SS2.
(List is thanks to Excel's sort function and Notepad++'s multi-line search-and-replace tool.)
interface IActReactSrv
* React - Execute a reaction response.
* Stimulate - Stimulate an object.
* Stimulate - Stimulate an object.
* GetReactionNamed - Return the reaction ID given its name.
* GetReactionName - Return the name of a reaction given its ID.
* SubscribeToStimulus - Register an object to receive stimulus messages of a particular type.
* UnsubscribeToStimulus - Stop listening for stimulus messages.
* BeginContact - Initiate a stimulus contact on an object.
* EndContact - Terminate stimulus contact on an object.
* SetSingleSensorContact - Briefly touch an object.
interface IAIScrSrv
* MakeGotoObjLoc - Instruct an AI to go to the current location of an object.
* MakeFrobObj - Instruct an AI to frob an object with another object.
* MakeFrobObj - Instruct an AI to frob an object.
* GetAlertLevel - Return the current alert level of the AI.
* SetMinimumAlert - Restrict the alert level of the AI.
* ClearGoals - Make the AI forget what it's doing.
* SetScriptFlags -
* ClearAlertness - Reset the alert level to it's lowest allowable value.
* Signal - Send a SignalAI message with a given string to the AI.
* StartConversation - Run a conversation pseudo-script.
interface IAnimTextureSrv
* ChangeTexture - Swap one texture on nearby polygons.
interface IBowSrv
* Equip - Set the bow as the current weapon.
* UnEquip - Clear the current weapon if it was the bow.
* IsEquipped - Check if the bow is the current weapon.
* StartAttack - Begin drawing the bow.
* FinishAttack - Release the bow.
* AbortAttack - Relax the bow without firing an arrow.
* SetArrow - Make an object the current projectile for the bow.
interface ICameraSrv
* StaticAttach - Attach camera to object. Do not allow freelook.
* DynamicAttach - Attach camera to object. Allow freelook.
* CameraReturn - Return the camera to Player if it's still attached to the object.
* ForceCameraReturn - Return the camera to Player unconditionally.
interface IContainSrv
* Add - Move an object into a container.
* Remove - Take an object out of a container.
* MoveAllContents - Move all the objects in one container into another.
* StackAdd - Modify the stack count of an object.
* IsHeld - Check whether an object is contained by another.
interface IDamageSrv
* Damage - Cause damage to an object.
* Slay - Slay an object.
* Resurrect - Reverse the effects of slaying an object.
interface IDarkGameSrv
* KillPlayer - Garrett dies. Ignored if no_endgame is set.
* EndMission - Immediately stop the current mission. Ignored if no_endgame is set.
* FadeToBlack - Gradually fade the screen. Ignored if no_endgame is set.
* FoundObject - Rings the secret bell.
* ConfigIsDefined - Test if a config variable has been set.
* ConfigGetInt - Return the value of a config variable interpreted as an integer.
* ConfigGetFloat - Return the value of a config variable interpreted as an floating-point number.
* BindingGetFloat - Return the floating-point value of a key-binding variable.
* GetAutomapLocationVisited - Return whether a region of the auto-map is marked as visited.
* SetAutomapLocationVisited - Mark a region of the auto-map as having been visited.
interface IDarkUISrv
* TextMessage - Display a string on the screen.
* ReadBook - Enter book mode.
* InvItem - Get the currently selected inventory item.
* InvWeapon - Get the currently selected weapon.
* InvSelect - Set an object to be the active inventory selection.
* IsCommandBound - Test if a command string is bound to a key sequence.
* DescribeKeyBinding - Return the key-binding for a particular command.
interface IDataSrv
* GetString - Retrieve a string from a resource file.
* GetObjString - Retrieve one of the standard object strings. Uses the GameName property.
* DirectRand - Return a (psuedo) random number in the range [0,32767]
* RandInt - Return a (psuedo) random number in a given range. The range is inclusive on both ends.
* RandFlt0to1 - Return a (psuedo) random floating-point number in the range [0,1].
* RandFltNeg1to1 - Return a (psuedo) random floating-point number in the range [-1,1).
interface IDebugScrSrv
* MPrint - Send string(s) to the mono.
* Command - Execute commands.
* Break - Raise a debugger interrupt.
interface IDoorSrv
* CloseDoor - Closes a door.
* OpenDoor - Open a door.
* GetDoorState - Return whether a door is open or closed (or something else).
* ToggleDoor - Switch the state of a door.
* SetBlocking - Set whether a door can block sound.
* GetSoundBlocking - Return if a door blocks sound.
interface IDarkInvSrv
* CapabilityControl -
* AddSpeedControl - Change the speed of Player.
* RemoveSpeedControl - Remove a previously applied speed control.
interface IDarkPowerupsSrv
* TriggerWorldFlash - Create a blinding flash.
* ObjTryDeploy - Create a new object at the location of another object.
* CleanseBlood - Slay nearby objects with Prox\Blood
interface IKeySrv
* TryToUseKey - Use or test a key on an object.
interface ILightScrSrv
* Set - Set the mode and min/max values of the light.
* SetMode - Set the current mode of the light.
* Activate - Clear the inactive flag on the light.
* Deactivate - Set the inactive flag on the light.
* Subscribe -
* Unsubscribe -
* GetMode - Return the current light mode.
interface ILinkSrv
* Create - Add a link between two objects.
* Destroy - Removes a link.
* AnyExist - Check if there is a link of a certain flavor between two objects.
* GetAll - Get all the links of certain flavor between two objects.
* GetOne - Get just one link of certain flavor between two objects.
* BroadcastOnAllLinks - Send a message to the destination of links from an object.
* BroadcastOnAllLinks - Send a message to the destination of links from an object, comparing data.
* CreateMany - Add links between many different objects.
* DestroyMany - Remove multiple links from objects.
* GetAllInherited - Retrieve links between objects and their descendants.
* GetAllInheritedSingle - Retrieve links between objects and their descendants.
interface ILinkToolsSrv
* LinkKindNamed - Get the ID of a link flavor
* LinkKindName - Get the name of a link flavor.
* LinkGet - Fill a structure with information about a link.
* LinkGetData - Retrieve the data associated with a link.
* LinkSetData - Set the data associated with a link.
interface ILockSrv
* IsLocked - Test whether an object has the Locked property set.
interface INetworkingSrv
* Broadcast - Send a message to over the network.
* SendToProxy - Send a message to an object on another computer.
* TakeOver - Become the host of an object.
* GiveTo - Let an object be hosted by a different object.
* IsPlayer - Check if an object is one of the players.
* IsMultiplayer - Check if the game is running in multi-player mode.
* SetProxyOneShotTimer - Send a timed message to the proxy for an object.
* FirstPlayer - Begin an iteration of all players.
* NextPlayer - Continue an iteration of all players.
* Suspend - Prevent network messages from propagating.
* Resume - Allow network communication again. (Possibly flushes queued messages?)
* HostedHere - Check if an object is hosted by this computer.
* IsProxy - Check if an object is hosted somewhere else.
* LocalOnly - Check if an object is locally specific.
* IsNetworking - Check if the computer is connected to a network.
* Owner - Get the object that hosts an object.
interface IObjectSrv
* BeginCreate - Do the first half of a two-stage object creation.
* EndCreate - Finish creating an object returned from BeginCreate.
* Create - Add an object to the database.
* Destroy - Remove an object from the database.
* Exists - Check if an object is in the database.
* SetName - Change an object's name.
* GetName - Return an object's name.
* Named - Find an object given a name.
* AddMetaProperty - Add a meta-property to an object.
* RemoveMetaProperty - Add a meta-property to an object.
* HasMetaProperty - Check if a meta-property is applied to an object.
* InheritsFrom - Check if an object inherits properties from another object. May be a direct ancestor or a meta-property.
* IsTransient - Check if an object is transient.
* SetTransience - Make an object transient, or not.
* Position - Get the location of an object.
* Facing - Get the direction an object is facing.
* Teleport - Set the position and direction of an object.
* IsPositionValid - Check if the object is inside the worldrep.
* FindClosestObjectNamed - Locate the object that is physically closest to a reference object.
* AddMetaPropertyToMany - Add a meta-property to multiple objects.
* RemoveMetaPropertyFromMany - Remove a meta-property from multiple objects.
* RenderedThisFrame - Check if the object was included in the last rendering pass.
interface IPGroupSrv
* SetActive - Turn a particle SFX on or off.
interface IPhysSrv
* SubscribeMsg - Register an object to receive certain messages.
* UnsubscribeMsg - Stop listening for certain messages.
* LaunchProjectile - Emit an object.
* SetVelocity - Set the current speed of an object.
* GetVelocity - Retrieve the current speed of an object.
* ControlVelocity - Lock the velocity of an object.
* StopControlVelocity - Unlock the velocity of an object.
* SetGravity - Set the gravity of an object.
* GetGravity - Retrieve the gravity of an object.
* HasPhysics - Check if an object has a physics model.
* IsSphere - Check if an object is a sphere.
* IsOBB - Check if an object is an oriented bounding-box.
* ControlCurrentLocation - Lock the location of an object to its current values.
* ControlCurrentRotation - Lock the facing of an object to its current values.
* ControlCurrentPosition - Lock the location and facing of an object to its current values.
* DeregisterModel - Remove the physics model of an object.
* PlayerMotionSetOffset -
* Activate -
* ValidPos -
interface IPickLockSrv
* Ready - Prepare a pick.
* UnReady - Release a pick.
* StartPicking - Begin using a pick on an object.
* FinishPicking - Stop picking an object.
* CheckPick - Test a pick.
* DirectMotion - ???
interface IPlayerLimbsSrv
* Equip - Display the player arm.
* UnEquip - Hide the player arm.
* StartUse - Begin moving the player arm.
* FinishUse - End an arm motion.
interface IPropertySrv
* Get - Retrieve some data from a property.
* Set - Write a value into a field of a property.
* Set - Write a value into a simple property.
* SetLocal - Write a value into a field of a property without propogating across the network.
* Add - Create an instance of a property on an object.
* Remove - Delete an instance of a property from an object.
* CopyFrom - Copy the contents of a property from one object to another.
* Possessed - Test if an object has an instance of a property.
interface IPuppetSrv
* PlayMotion - Play a motion schema on an object.
interface IQuestSrv
* SubscribeMsg - Register an object to receive notifications when a quest variable changes.
* UnsubscribeMsg - Stop listening for quest variable messages.
* Set - Change the value of a quest variable.
* Get - Retrieve the value of a quest variable.
* Exists - Test if a quest variable is defined.
* Delete - Remove a quest variable from either database.
interface IShockGameSrv
* DestroyCursorObj - Destroy the current cursor object.
* DestroyInvObj - Destroy an object which may be in the player's inventory.
* HideInvObj -
* SetPlayerPsiPoints - Modify the player's psi points.
* GetPlayerPsiPoints - Get the player's psi points.
* AttachCamera -
* CutSceneModeOn -
* CutSceneModeOff -
* CreatePlayerPuppet -
* CreatePlayerPuppet -
* DestroyPlayerPuppet -
* Replicator - Display the replicator interface.
* Container - Display the container interface.
* YorN - Display a yes-or-no propmpt.
* Keypad - Display the keypad interface.
* HRM - Display Hack/Repair/Modify interface
* TechTool - Display the research status interface.
* UseLog -
* TriggerLog - Displays a log message.
* FindLogData - Retrieve log data from an object.
* PayNanites - Attempt to subtract nanites from the player.
* OverlayChange - Change the status of an overlay panel.
* Equipped - Get the object contained in a particular slot.
* LevelTransport - Change the mission map.
* CheckLocked - Determine if a creature can open an object.
* AddText - Display text on a player's screen.
* AddTranslatableText - Display a string from a resource.
* AmmoLoad - Add or change the ammunition in a gun.
* GetClip - Get the size of a clip.
* AddExp -
* HasTrait - Check if a player has a trait.
* HasImplant - Check if a player is using an implant.
* HealObj - Add hit points to an object.
* OverlaySetObj - Associate an object with an interface panel.
* Research -
* GetArchetypeName - Get the name of an object's archetype.
* OverlayOn - Check if an overlay panel is currently displayed.
* FindSpawnPoint - Get the nearest spawn point.
* CountEcoMatching -
* GetStat -
* GetSelectedObj - Return the currently selected object.
* AddInvObj - Put an object in the player's inventory.
* RecalcStats - Adjust an objects state after having modified its properties.
* PlayVideo - Display a movie.
* ClearRadiation - Cancel the radiation hazard.
* SetPlayerVolume -
* RandRange - [low, high]
* LoadCursor - Set the cursor object.
* AddSpeedControl - Change the speed of Player.
* RemoveSpeedControl - Remove a previously applied speed control.
* PreventSwap - Avoid changing the cursor object when an inventory object is selected.
* GetDistantSelectedObj -
* Equip - Put an object in an inventory slot.
* OverlayChangeObj - Set the state and associated object of an interface panel.
* SetObjState - Change the state of an object.
* RadiationHack -
* DestroyAllByName -
* AddTextObjProp - Display the resource string from an object's property.
* DisableAlarmGlobal - Turn off all alarms.
* Frob - Make the player frob the currently selected item.
* TweqAllByName -
* SetExplored - Set whether a location has been explored.
* RemoveFromContainer - Remove an object from a container.
* ActivateMap - Display the auto-map.
* SimTime - Get time the game has been active.
* StartFadeIn - Set the screen to a solid color, then gradually fade to full visibility.
* StartFadeOut - Gradually transition to a solid color.
* GrantPsiPower - Give a psi ability to a player.
* ResearchConsume - Attempt to use an object in the current research process.
* PlayerMode - Set the player mode.
* EndGame -
* AllowDeath - Return whether the player dying should end the game.
* AddAlarm - Add time to the security alarm.
* RemoveAlarm - Immediately cancel the security alarm.
* GetHazardResistance - Get the player's resistance to a type of damage.
* GetBurnDmg - Get the amount of damage done by a psi overload.
* PlayerGun - Get the current gun being wielded by the player.
* IsPsiActive - Check if a psy power is being used.
* PsiRadarScan -
* PseudoProjectile -
* WearArmor - Set or clear the armor.
* SetModify - Change the modification state of a gun.
* Censored - Return whether blood should not be shown.
* DebriefMode -
* TlucTextAdd - Display a string in an overlay at the center of the screen.
* Mouse - Show or hide the cursor.
* RefreshInv - Update the state of the inventory.
* TreasureTable - Add an object to the loot(?) list.
* OverlayGetObj -
* VaporizeInv - Destroy all objects in the player's inventory.
* ShutoffPsi - Deactivate all psi powers.
* SetQBHacked - Set the value of a quest variable.
* GetPlayerMaxPsiPoints - Return the maximum psi points the player can have.
* SetLogTime -
* AddTranslatableTextInt - Display a string with a replaceable parameter.
* ZeroControls -
* SetSelectedPsiPower - Set the current psi power.
* ValidGun - Check if an object is a gun.
* AddTranslatableTextIndexInt - Display an indexed string with a replaceable parameter.
* IsAlarmActive - Check if the security alarm time is greater than zero.
* SlayAllByName -
* NoMove - Prevents or allow the player to move. Turning and free-look are still allowed.
* PlayerModeSimple -
* UpdateMovingTerrainVelocity -
* MouseCursor - Check if the cursor is on-screen.
interface IShockObjSrv
* FindScriptDonor - Get the object from which a particular script is inherited from.
interface IShockPsiSrv
* OnDeactivate -
* GetActiveTime -
* IsOverloaded -
interface IShockAISrv
* Stun -
* IsStunned -
* UnStun -
* Freeze -
* UnFreeze -
* NotifyEnterTripwire - Tell an AI that it is approaching a door.
* NotifyExitTripwire - Tell an AI that it is leaving the vicinity of a door.
* ObjectLocked - Test if an AI is able to open a door.
* ValidateSpawn -
interface IShockWeaponSrv
* SetWeaponModel -
* GetWeaponModel -
* TargetScan -
* Home -
* DestroyMelee -
interface ISoundScrSrv
* Play - Play a schema at a specific location.
* Play - Play a schema at the location of an object.
* Play - Play a schema.
* PlayAmbient - Play an ambient schema.
* PlaySchema - Play a schema object at a specific location.
* PlaySchema - Play a schema object at the location of an object.
* PlaySchema - Play a schema object.
* PlaySchemaAmbient - Play an ambient schema object.
* PlayEnvSchema - Play an environmental schema.
* PlayVoiceOver - Play a voice-over schema.
* Halt - Stop playing a schema.
* HaltSchema - Stop playing a schema.
* HaltSpeech - Prevent an AI from speaking.
* PreLoad - Read the waveform data for a schema before having to play it.
interface IWeaponSrv
* Equip - Select an object as the current weapon.
* UnEquip - Clear the current weapon, if selected.
* IsEquipped - Check if a particular object is the current weapon.
* StartAttack - Begin swinging the weapon.
* FinishAttack - Stop swinging the weapon.
LarryG on 7/1/2009 at 21:13
hmm ... Command - Execute commands might open things up a bit.
I assume that means console commands like:
* ambient, * ambient_dump, * ambient_volume_down, * ambient_volume_up, * contrast, * eval, * light_bright, * light_scale, * line_loadfile, * obj_ambient, * ...
If true and if we understand all the command console commands, there should be a whole lot one could be able to accomplish via scripts ...