[Release] Plutoscript Framework

Topic created Β· 20 Posts Β· 1114 Views
  • A collection of plugins to boost Plutonium IW5 script capabilities. https://github.com/xensik/plutoscript


    Install

    Download the files from https://github.com/xensik/plutoscript/releases
    Place plutoscript-framework.dll in 'plutoniumfolder'/storage/iw5/plugins


    Usage


    GSC Callbacks

    Enables use of gsc thread calls.

    Known Bugs:

    • Dont use entity fields at Scr_PlayerDamage, spaming entity field calls in a short period of time makes chai crash.

    chaiscript:

    def onStartupGameType()
    {
    
    }
    
    add_callback_startup_game(onStartupGameType);
    
    /* Params
    	ePlayer: 	entity
    	return: 	void
    */
    def onPlayerConnect(ePlayer)
    {
    
    }
    
    add_callback_player_connect(onPlayerConnect);
    
    /* Params
    	args: 		vector
    	return: 	void
    */
    def onPlayerConnected(args)
    {
    	var ePlayer = args[0];
    	
    }
    
    level.onNotify("connected", onPlayerConnected);
    
    /* Params
    	args: 		vector
    	return: 	void
    */
    def onPlayerSpawned(args)
    {
    	var ePlayer = args[0];
    }
    
    level.onNotify("player_spawned", onPlayerSpawned);
    
    /* Params
    	ePlayer: 	entity
    	return: 	void
    */
    def onPlayerDisconnect(ePlayer)
    {
    
    }
    
    add_callback_player_disconnect(onPlayerDisconnect);
    
    /* Params
    	ePlayer:		entity
    	eInflictor: 		entity
    	eAttacker:		entity
    	iDamage:		integer
    	iDflags:		integer
    	sMeansOfDeath:		string
    	sWeapon:		string
    	vPoint:			vector
    	vDir:			vector
    	sHitloc:		string
    	iTimeOffset:		integer
    	return:			void
    */
    def onPlayerDamage(ePlayer, eInflictor, eAttacker, iDamage, iDflags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitloc, iTimeOffset)
    {
    
    }
    
    add_callback_player_damage(onPlayerDamage);
    
    /* Params
    	ePlayer:		entity
    	eInflictor: 		entity
    	eAttacker:		entity
    	iDamage:		integer
    	sMeansOfDeath:		string
    	sWeapon:		string
    	vDir:			vector
    	sHitloc:		string
    	iTimeOffset:		integer
    	iDeathAnimDuration: 	integer
    	return:			void
    */
    def onPlayerKilled(ePlayer, eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitloc, iTimeOffset, iDeathAnimDuration)
    {
    
    }
    
    add_callback_player_killed(onPlayerKilled);
    

    Chat Messages

    Adds support to write messages from the server.

    chaiscript:

    chat_raw_say_all("hello from chai");
    

    output: hello from chai

    chat_say_all("hello boyz");
    

    output: console: hello boyz

    chat_say_all("myserver", "hello boyz");
    

    output: myserver: hello boyz

    chat_raw_say_to(player.getEntityNumber(), "welcome");
    

    output (only displayed to player): welcome

    chat_say_to(player.getEntityNumber(), "hello bro");
    

    output (only displayed to player): console: hello bro

    chat_say_to(player.getEntityNumber(), "myserver", "ban warning (1/3)");
    

    output (only displayed to player): myserver: ban warning (1/3)

    Support for using entities directly will be added in the future (chat_say_to(player, "hi");)


    Commands

    Handle server and client commands

    chaiscript:

    Execute a server command:

    cmd_execute("map_restart");
    

    Handlers comming soonβ„’


    Info

    iDamage & iDFlags values are passed by reference, you can edit them to modify GSC behavior.

    Means of Death names:

    MOD_UNKNOWN
    MOD_PISTOL_BULLET
    MOD_RIFLE_BULLET
    MOD_EXPLOSIVE_BULLET
    MOD_GRENADE
    MOD_GRENADE_SPLASH
    MOD_PROJECTILE
    MOD_PROJECTILE_SPLASH
    MOD_MELEE
    MOD_HEAD_SHOT
    MOD_CRUSH
    MOD_FALLING
    MOD_SUICIDE
    MOD_TRIGGER_HURT
    MOD_EXPLOSIVE
    MOD_IMPACT
    

    Hit Location names:

    none
    helmet
    head
    neck
    torso_upper
    torso_lower
    right_arm_upper
    left_arm_upper
    right_arm_lower
    left_arm_lower
    right_hand
    left_hand
    right_leg_upper
    left_leg_upper
    right_leg_lower
    left_leg_lower
    right_foot
    left_foot
    shield
    

    Have fun modding, xensik.

  • Looks to be the start of something great OP πŸ™‚

  • Great stuff.

  • My man be doing some great work.
    Good luck with this @xensik

  • [Updated] killcams fixed.

  • Added chat support & command execution.

  • How could I implement this into an existing c++ chai?

    Like include and use the gsc functions

  • any update on the next release?

  • The chat functions and the overall project looks cool. Keep it going. πŸ™‚

  • plutoscript fails to load for me no matter what, anybody have the same issue?

  • @fed yeah same for me, started happening since one of the last updates

  • guys, sorry for being off. They changed memory permissions on recent builds. i will make a quick update by now.

    working on something new for the last month since chaiscript πŸ’©

    some preview πŸ‘€

    pic.png

  • awesome, can't wait

  • fixed memory permissions, should work in newer plutonium versions.

  • nice؜

  • Yo, I forked your plutoscript, and added some patches to include controlling individual bot's input buttons, movement input and weapons (all native engine input) through the use of setting DVARs.

    It also fixed the issue of bots being stuck on 'connecting' when a map rotation occurs.

    https://github.com/ineedbots/plutoscript/blob/master/src/framework/callbacks.cpp#L49

    So;

    bot<botnum>_buttons => <32BITMASK of buttons being pressed>

    1 ->fire button
    2 -> sprint
    4 -> melee
    etc.

    so; 'bot0_buttons 1' makes the bot in the first player slot to press down the FIRE button.

    bot<botnum>_movement => <-127 to 127> <-127 to 127>
    a vector[2] of bot movement,

    so; 'bot4_movement 127 0' makes the bot in the 5th player slot to walk forward

    bot<botnum>_weapon => a string name of a weapon

    so; 'bot17_weapon frag_grenade_mp' makes the bot in the 18th player slot to switch to the frag grenade weapon.

    DEMO: https://cdn.discordapp.com/attachments/455102469681184771/796515575747706891/bot_dvar.mp4

    I plan on writing Bot Warfare for IW5 using these DVARs to control the bots. So I am really looking forward to GSC support!

  • @xensik just now seeing this - this looks so fucking cool

  • @INeedGames I'm too dumb to understand it, but are you saying that it can be bots in mw3 ?

  • when in-game; spawn a bot with bot

    once hes spawned in, you can control him with dvars;

    bot1_buttons 1 will make the bot hold the fire button,
    bot1_buttons 4 will make the bot hold the knife button,
    bot1_movement 127 0 will make the bot move forward

  • @INeedGames Bot warfare will live on for a long time a great service you do. I hope they are as smooth as the new version of bots. crazy to go from pezbots along time ago to this exciting mod!

Log in to reply