[HELP] Raising player troops attribute and speed

正在查看此主题的用户

DeepRedCee

Recruit
Hi there,

Basically I'm trying to increase a player's movement speed through increasing their agility and athletics attribute.

This is what the script looks like so far, it is called through a (call_script) when a key is pressed. I know the script is being run when the key is pressed because the sound inside it is played.

插入代码块:
 ("cf_blackberrybuff",
  [(get_player_agent_no, ":player_agent"),
	(agent_is_alive, ":player_agent"),
	(agent_get_position, pos0, ":player_agent"),
	(assign, ":agentpos", pos0),
  (try_begin),
	(troop_raise_attribute, ":player_agent", ca_agility, 10),
	(troop_raise_skill, ":player_agent", "skl_athletics", 50),
	(call_script, "script_multiplayer_server_play_sound_at_position", "snd_fireworkbang", ":agentpos", 0),
	(play_sound_at_position, "snd_fireworkbang", ":agentpos"),
  (try_end),
  ]),

Basically, the sound is played but as far as I can tell the player's attributes or skills aren't changed at all, I tried this with iron flesh as well.

Any help would be greatly appreciated! Cheers guys.
 
No, you can't use trp_player, it would change the skills for every Agent that used trp_player as their basis. 

No, you can't raise Agent skills.  They're derived from the Troop.

You could, however, assign every single player to a different Troop.

And if all you want to do is change their movement speeds, use agent_set_speed_modifier.
 
Yeah I tried using the agent_set_speed modifier but it didnt exist in my version of the module system (im using 1.143) so i tried adding it to the header and using it anyway (it compiled and everything but there was no effect in game).

Basically (in the end) I want a script that increases the skills of every player and bot around the person who uses it, like a buff item. Obviously it would wear off over time but for now I'm just focussing on increasing the skills.

I know Napoleonic wars does something similar with their buffs system but I'm not sure how they implemented it with accuracy bonuses and such.

Thanks loads for your help and replying by the way
 
it didnt exist in my version of the module system (im using 1.143)
You just need to update your header files, so that you can use the new operations, is all.  You just need to download the latest source and replace the header files. 

I strongly suggest you do that immediately, instead of continuing to use older versions of the headers.

Basically (in the end) I want a script that increases the skills of every player and bot around the person who uses it, like a buff item.
NW is just using the special operations added for them, such as agent_set_accuracy_modifier.  They just do a periodic check, and if an Agent that can give a buff is doing the buff activity, then any nearby friendly Agents get a buff.  It's very straightforward trigger stuff.

However, most things that Agents derive from Troop stats cannot be altered.  For example, you can't alter an Agent's Athletics on the fly.  It's too bad that the engine works this way, but it's how it works.
 
Ah thanks for the tip off on the headers I didnt know that was all you needed to do, happy now haha.

Ah I see, well I guess I'll have to find some way around it either a new idea or leave it till a later date. Thanks for all your help :grin:
 
后退
顶部 底部