It is currently Sat Apr 27, 2024 8:38 pm

RUNNING WITH RIFLES Multiplayer

test

Game servers 46 List provided by EpocDotFr | Players online 36


All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Scripting
PostPosted: Tue Oct 20, 2015 6:57 pm 
Offline

Joined: Sat Oct 05, 2013 12:19 am
Posts: 635
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.


Top
 Profile  
 
 Post subject: Re: Scripting
PostPosted: Wed Oct 21, 2015 9:10 am 
Offline
Site Admin

Joined: Mon Jun 27, 2011 11:59 am
Posts: 2856
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.


Top
 Profile  
 
 Post subject: Re: Scripting
PostPosted: Wed Oct 21, 2015 11:36 am 
Offline

Joined: Sat Oct 05, 2013 12:19 am
Posts: 635
Hm, I see. Since I can't get it through scripting, is there any other way to accomplish this?


Top
 Profile  
 
 Post subject: Re: Scripting
PostPosted: Thu Oct 22, 2015 11:30 am 
Offline
Site Admin

Joined: Mon Jun 27, 2011 11:59 am
Posts: 2856
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.


Top
 Profile  
 
 Post subject: Re: Scripting
PostPosted: Sun Oct 25, 2015 8:24 pm 
Offline

Joined: Sat Oct 24, 2015 12:16 pm
Posts: 1
What is really the main function of scripting?How does it affect to the gameplay, the weapon or to the Players itself?

_________________
automatic knives


Top
 Profile  
 
 Post subject: Re: Scripting
PostPosted: Wed Oct 28, 2015 2:07 pm 
Offline

Joined: Sat Oct 05, 2013 12:19 am
Posts: 635
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.


Top
 Profile  
 
 Post subject: Re: Scripting
PostPosted: Sun Nov 01, 2015 5:16 pm 
Offline

Joined: Wed Oct 21, 2015 1:39 am
Posts: 2
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 :)


Top
 Profile  
 
 Post subject: Re: Scripting
PostPosted: Sun Nov 01, 2015 5:18 pm 
Offline

Joined: Wed Oct 21, 2015 1:39 am
Posts: 2
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?


Top
 Profile  
 
 Post subject: Re: Scripting
PostPosted: Sun Nov 01, 2015 7:57 pm 
Offline
Site Admin

Joined: Mon Jun 27, 2011 11:59 am
Posts: 2856
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group