Interesting idea do you think it will work?

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
ZenBudha
Posts: 285
Joined: Wed Aug 17, 2005 6:06 am
Contact:

Interesting idea do you think it will work?

Post by ZenBudha »

I was pondering on how to allow the player to customize weapons, etc. Since I'm not a coder it has to be doable with what RF has currently.

Anyway I was thinking if I set up certain areas with work benches. Like shop areas, etc. Then the player could approach it like an NPC and converse with it.

Then have it check the players inventory for key items, and then ask if they want to customize it. Such as the player might find a double barrelled shotgun of the store bought kind. Then he might find a hacksaw. By using a workbench it would give him the option of converting it to a sawed-off shotgun.

It would simply look for a shotgun, and a hacksaw. If both were present it would ask the player if he wished to build a sawed-off shotgun. Answer yes and it would delet the double barreled shotgun from the players inventory, and replace it with a sawed-off version.

Various tools would allow modification to other types of weapons, ammo, items, etc. Not a major feat or anything just an extra little something to add to the gameplay.
Fear not the textures for the almighty stylus is with thee - Book of Zen
Jay
RF Dev Team
Posts: 1232
Joined: Fri Jul 08, 2005 1:56 pm
Location: Germany

Post by Jay »

You could do it with a conversation script. You can use the ConversationScriptGenerator to check for the required items, remove the shotgun from the players inventar, then give the player the sawed-off version. The sawed-off version has to be an own weapon; Problem is: i think there is a maximum number of weapons.
Everyone can see the difficult, but only the wise can see the simple.
-----
User avatar
ZenBudha
Posts: 285
Joined: Wed Aug 17, 2005 6:06 am
Contact:

Post by ZenBudha »

Yeah by default I believe it's 10 weapons. However it should leave plenty of room so long as the player doesn't have 10 different weapons to customize.
Example weapons...

You can script in more weapons when using a scripted player. Such as the Half-Life style weapons selection script example: You press 2 and get a revolver, you press 2 again and you get a 9mm, etc.

Also could be scripted to use a next weapon previous weapon key.
Fear not the textures for the almighty stylus is with thee - Book of Zen
Lupus
Posts: 10
Joined: Tue Sep 27, 2005 9:17 am

Post by Lupus »

The true(not by default) limit is greater than ten... But the engine only uses ten weapon keys(Doom, etc... style) on the keyboard... The real problem here comes down to combinations, and implementation. A script could easily manage the data needed for customizable weapons, but would be extremely difficult to implement without a scripted player(and, last I checked(a few months ago), it would be quite difficult with a scripted player as well...) I'm rusty as hell right now, but from the look of the downloads page, RF has not changed much since my lasta excursions...

From what I know, this would be best implamented with:

1. A script to manage the actual weapon customizing.
2. Code to support saving data relative to weapons (Yesa... Real programming, ooooo.....)
3. A player script to utilize the custom weapon features(Which may or may not require programming...)

Now, take that at face value... I said I was rusty.
Life is the software of reality...
If you think it isn't fair, ask God to hack the code!
User avatar
ZenBudha
Posts: 285
Joined: Wed Aug 17, 2005 6:06 am
Contact:

Post by ZenBudha »

The Half-Life style weapon selection script has already been done and tested. This would definitely be for a scripted player though. However it's no big problem.

Example lets say all shotguns fall under the "4" key. So if the player had a double barelled shotgun, and a pump shotgun pressing the 4 key once would give him the doule barreled, and again the pump shotgun.

However if the double barrelled shotgun is removed, and he has a sawed-off shotgun instead. When he pressed 4 he will get the sawed-off shotgun, and again he will get the pump shotgun. If there was an auto shotgun pressing 4 again might give him that shotgun.

So it's really not a problem so long as I can get the conversation script to check for the appropriate weapons and tools, and then remove the weapon and add the second weapon to the player inventory.
Fear not the textures for the almighty stylus is with thee - Book of Zen
Post Reply