RUNNING WITH RIFLES
http://www.runningwithrifles.com/phpBB3/

Scripting
http://www.runningwithrifles.com/phpBB3/viewtopic.php?f=7&t=2569
Page 1 of 1

Author:  The Soldier [ Tue Oct 20, 2015 6:57 pm ]
Post subject:  Scripting

Alright, I've got a little project going on and what I'd like to do will require some scripting. I've got some experience with coding in general, but PHP is completely unknown to me and I have no idea of what the general commands are for PHP. I'm by no means asking any of you to just make this script, but if I could at least get some help, that would be much appreciated. :D

it's not exactly the normal scripting with game modes or spawning stuff, but it'll turn out to be really fun if it is possible. So, the very basic idea is to make a soldier swap from his primary weapon to his secondary weapon, either on a per-soldier or a per-squad basis (both will function fine, but the per-squad basis would make it look a bit nicer). The requirements would be (for a per-soldier basis) a random chance of happening after emptying their magazine at the enemy, or (on a per-squad basis) when at least 50% of the squad has an empty magazine. If I could have some help getting this accomplished, that would be very awesome.

Author:  pasik [ Wed Oct 21, 2015 9:10 am ]
Post subject:  Re: Scripting

Challenges I see:

* scripting can't do 1st/2nd weapon swap input
Closest to inventory handling you can get with the commands is with update_inventory.
Spoiler:
<command
class="update_inventory"
character_id="0"
container_type_class="stash"
add="1"
instance_class="carry_item"
instance_key="painting.carry_item">
</command>

container_type_class="equip" is not wired, but you can still achieve the same with container_type_id="4". Now, I have no idea if that results in anything sensible, it hasn't been tested and it hasn't been intended to work. Omitting add="1" will attempt removal of said item type.

* tracking bullets left in a weapon
Every bullet shot isn't reported to the scripting side as events, so you'd need to do periodical monitoring of character data and examine the weapon state. Too bad it doesn't seem to be possible either, as per character the scripting can receive data such as id, name, position, block, dead, faction_id, xp, rp, leader.

Author:  The Soldier [ Wed Oct 21, 2015 11:36 am ]
Post subject:  Re: Scripting

Hm, I see. Since I can't get it through scripting, is there any other way to accomplish this?

Author:  pasik [ Thu Oct 22, 2015 11:30 am ]
Post subject:  Re: Scripting

Can't see a way without getting to sources, sorry.

The script support has been made mainly for high level gamemode features, not really for low level character control stuff.

Author:  jacob [ Sun Oct 25, 2015 8:24 pm ]
Post subject:  Re: Scripting

What is really the main function of scripting?How does it affect to the gameplay, the weapon or to the Players itself?

Author:  The Soldier [ Wed Oct 28, 2015 2:07 pm ]
Post subject:  Re: Scripting

The main point of scripting is to make new game modes. It can track items that players have, but it's main functions are much grander in scale.

Author:  SomeoneFromChina [ Sun Nov 01, 2015 5:16 pm ]
Post subject:  Re: Scripting

pasik wrote:
Can't see a way without getting to sources, sorry.

The script support has been made mainly for high level gamemode features, not really for low level character control stuff.

<command class='set_marker' faction_id='0' position='" . $p . "' color='0 0 1' atlas_index='0' text='" . $text . "' />
Looking for someway to remove this mark :)

Author:  SomeoneFromChina [ Sun Nov 01, 2015 5:18 pm ]
Post subject:  Re: Scripting

pasik wrote:
Can't see a way without getting to sources, sorry.

The script support has been made mainly for high level gamemode features, not really for low level character control stuff.

And is there anywhere to find command classes and usages?

Author:  pasik [ Sun Nov 01, 2015 7:57 pm ]
Post subject:  Re: Scripting

SomeoneFromChina wrote:
pasik wrote:
Can't see a way without getting to sources, sorry.

The script support has been made mainly for high level gamemode features, not really for low level character control stuff.

<command class='set_marker' faction_id='0' position='" . $p . "' color='0 0 1' atlas_index='0' text='" . $text . "' />
Looking for someway to remove this mark :)


Try adding in enabled='0' to clear the marker. Please see http://runningwithrifles.gamepedia.com/ ... uts_to_RWR for more commands.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/