GithubHelp home page GithubHelp logo

baso88 / sc_angelscript Goto Github PK

View Code? Open in Web Editor NEW
40.0 9.0 5.0 1.71 MB

Sven Co-op AngelScript documentation, tutorials, sample code and tools

Batchfile 0.03% CSS 0.80% C++ 97.95% C 1.22%
svencoop angelscript

sc_angelscript's People

Contributors

baso88 avatar joshaber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sc_angelscript's Issues

Entity created

Script types: All.

Called when a new entity is created (e.g. a monster or weapon projectile). The newly created CBaseEntity would be passed as a parameter.

info_player_* triggering

Script types: All.

Allow handling upon activating the "checkpoints" in most maps, this would allow implementing survival mode in a much easier way on unsupported maps.

Potentially allow spawn blocking.

Note: info_player_start is treated by game code as though it inherits from the same base class as info_player_deathmatch and other info_player_* entities. Consider fixing this before adding the hook and exposing the base class for use here.

Player Leap

Script types: All.

Allow handling upon long jumping.

Note: long jumping is handled by the player physics code, which is written in C. Consider converting to C++ to allow direct access to the hook.

[Hook::Player::PlayerCanRespawn] &bCanRespawn does not prevent respawn

Reference Code: https://github.com/MrOats/AngelScript_SC_Plugins/releases/tag/SM_v4.0

In my plugin listed above, I left notes and ability to test trying to stay in Observer mode through setting &bCanRespawn for specific players. From what I found is that with bCanRespawn set to false, instead of when the timer counts to 0 on your screen and changes to "You can respawn now!", you are forcefully respawned with your gun not showing but able to shoot. With it set to true, it shows "You can respawn now!" and awaits for input like it should.

File::ReadLine doesn't handle CRLF line endings properly

File::ReadLine reads until the given delimiter is reached, which is '\n' by default. On Windows, the OS will read CRLF as LF ('\n'), on Linux this is read as CRLF ("\r\n"), causing problems when lines are read in one at a time. Special handling is required when the delimiter is '\n' to ignore any '\r' preceding it.

Make Cvar methods const

The Cvar class methods are non-const, preventing them from being called if you have a const handle to an instance. Cvar is the native cvar class, not the Angelscript version.

See AngelScript CVarGetPointer bug?

Also consider adding helper methods to set the value for cvars directly by passing them through to enginefuncs_t::pfnCvar_DirectSet. Providing a helper method to convert to float would be nice.

Reported by Duko.

Add SQL support

Add support for SQL. MySQL for plugins, SQLite for plugins and map scripts.

Player Damage (to target)

Script types: All.

Getting target type, damage dealt, damage type, etc.

Note: Same as #3, but intended to work with Brush entities instead of Monsters/Players.

PlayerPreThink

Script types: All.

Currently available only to map scripts. Making it available to plugins would prove helpful.

Player suicide attempt

Script types: Map scripts only (consider adding for plugins as well)

Allow map scripts to prevent players from suiciding, or potentially handle it themselves.

pfnAddToFullPack

Script types: All.

Well, you know what AddToFullPack is used for - per-player entity states. No idea what would it be useful for right now, but I am sure people would come up with something good eventually. There were numerous AMXX plugins using it.

Could be used for per-player effects not visible to other players.

Directory and file iteration

Add the ability to iterate over directories and files in another directory through the virtual filesystem.

This would prove useful to precache entire directories at once, for example to precache all vox sounds for use in a plugin.

Add monster navigation code to the API

Add monster navigation code to the API. This includes methods like FTriangulate, InsertWaypoint, BuildNearestRoute, etc. Virtual methods should be evaluated for inclusion as overrideable methods.

Custom entity support in plugins is non-functional

5.0.7's changelog says this:
"Server plug-ins are now allowed to register custom entities."

While the access mask for those methods was changed, you forgot pretty much everything else.

Custom entities require headers to be included so script classes can inherit from them properly. You also didn't set the access mask for custom weapon functions so you can't register custom weapons.

You also didn't update the code to use the calling module to check for the class name that was passed in, so it always tries to find classes in the map module.

Add option to set sound/sentence replacement list in Angelscript

Add functions to set these to any file, provide a means to create replacement maps in Angelscript.

This means:

  • Create new replacement map of a particular type
  • Add string pairs to it
  • Set map on entity

(sentence replacement can only work if done in MapInit due to sound system limitations)

Player Revived

Script types: All

Allow scripts to handle the event when a player is Spawned via a Revive (Medkit, or NPC revive).

[Request] Expose new stuff

This is a request to expose:
studio.h,
com_model.h,
model_t,
studiohdr_t and
studio
That would allow easy model access.
Also gamerules, with a easy option to add our own rules.
Access to Player Model Overrides if it's not there, along with UserInfo Changed #12 and EntityCreated #10 hooks.

[Custom Weapons] Exhaustible weapons refer to temporary string for classname

Exhaustible weapons (ItemInfo.iFlags & ITEM_FLAG_EXHAUSTIBLE) refer to a temporary string for the classname. This causes problems when you try to pick up dropped instances of these weapons. To fix this, go to CASItemRegistry::RegisterItem and change the following line:

UTIL_PrecacheOtherWeapon( szName.CStr() );

To:

UTIL_PrecacheOtherWeapon( ALLOC_STRING( szName.CStr() ) );

This will ensure it uses a string that is valid for the duration of the map.

PlayerPostThink

Script types: All.

Currently available only to map scripts. Making it available to plugins would prove helpful.

CPlayerFuncs::AdminLevel should have overload that takes edict_t@

CPlayerFuncs::AdminLevel returns the admin level of the given player. Unfortunately, it takes a CBasePlayer@ (like the underlying AdminLevel function it forwards to) so you can't use it in the ClientConnected and CanPlayerUseReservedSlot hooks.

Users may want to verify the player's admin level in those hooks to check if they should be allowed to join, which is impossible because it requires a CBasePlayer.

Add an overload that takes an edict_t@ so this can be done. (I'm aware that CBasePlayer's members are accessed when checking for an admin level, just refactor the function into 2 parts so the edict only part at the end can be called at any time)

Player Touch Ground

Script types: All.

Allow handling upon falling to the ground. Either to remove all kind of fall damage or reduce momentum (to disable bhopping)

WeaponPickup hook

Scripts types: Both

Called when weapon is picked up. The weapon itself and the player picking it up should be passed in.
The weapon id can be retrieved using CBasePlayerWeapon.m_iId, so it should not be passed in separately.

Add implicit conversion from char to uint32

Add an implicit conversion between char and uint32.

unsigned int Char_ToUint32( const char& c )
{
    return static_cast<unsigned int>( c );
}

pDocumentation->RegisterObjectMethod( "Implicitly converts this character to an unsigned 32 bit integer",
    pszObjectName, "uint32 opImplConv() const",
    asFUNCTION( Char_ToUint32 ), asCALL_CDECL_OBJFIRST );

ClientUserInfoChanged

Script types: All.

This function is called by the engine whenever the client userinfo string changes. This includes name and player model changes. Consider making this available and allowing scripts to veto changes. Map scripts may be too dangerous for this, discuss.

Note: changes are already made by the time they reach this function. Vetoing must be done by reverting changes.

[Request] Built-In hook PluginReloaded()

Would be nice to have a separate procedure for when as_reloadplugin(s) is called for the plugin instead of having to take care of it when it first loads. Such as defining a Scheduler object twice on first load, and having to redefine it on as_reloadplugin(s).

IRelationship override hook

Script types: Map scripts only.

Add a hook to override IRelationship's lookup so the map script can decide which relationships exist between which monster classes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.