Page 1 of 1
Weapon and player scripting
Posted: Sat Sep 03, 2005 3:47 pm
by Kamazy
My request is for a way to script weapon rather than editing .inis this way the creator will have more freedom to do what me wants.
And a way to remap scripted controls from in the game.
maybe if you attach the script with a .ini for the controls and have RF remap the .ini file much like now.but this will let the creator create custom controls and actions like Diveing and rolling. Also there won't be a use for the player\pawn any more since the player will be able to do anything.
I don't know if this is easy or hard but if you guys can get it to be like HL anything should be possible Thanks. And what features should i expect in the next version.
Posted: Sun Sep 04, 2005 4:52 am
by MakerOfGames
To do what you want, you can use a scripted player. Scripted players are nothing more than pawns that are programmed to do what you want. There is a nifty little line of code you can use to get a pawn to accept key commands. It is as follows:
self.key_pressed()
Yep, thats it.
The number of the corresponding key goes into the parenthesis. To get the numbers of the keyboard commands, go to the scripting forum and look at my post titled RF Key Codes.
That should enable you to do everything you want to do in RF. With a scripted player, you choose the control scheme, and all the actions available to the player. You can even program cheats in, but that is a whole other topic. I am using a scripted player for my duel weilding ability in my FPS(look at the duel guns post in this forum section to read about what I plan to do and am working on.).
I hope that helps. Now if you have any other questions about using the scripting engine to get the advanced effects you want, please direct them to the scripting forum.
Posted: Sun Sep 04, 2005 3:27 pm
by Jay
it's not self.key_pressed() but self.key_pressed and it is used as follows:
if(self.key_pressed = keyboard control number)
{
//Do something
}
Posted: Sun Sep 04, 2005 4:22 pm
by Kamazy
Thanks For the reply i'l try the pawn\player and see what happens.
Posted: Mon Sep 05, 2005 11:56 am
by Gamespider
I posted the same question in the scripting forum. Wanted to make weapons do custom things.... didnt get a proper answer.
Posted: Mon Sep 05, 2005 9:26 pm
by ZenBudha
Well I dunno about a scripted weapon, but a setting in the weapon.ini for changing accuracy would be awesome.
As right now everything is pretty much a laser gun, and the whole trying to use two pawns to get 1 weapon to have innacuracy etc is obscene.
I experimented to the point of pulling out my hair and finally just gave up. Most FPS games I have played have a config file or some just a text file you can adjust to change a weapons accuracy.
That and perhaps an .ini setting for recoil amount and direction.
This has been the biggest problem when trying to make a FPS game with RF. Minly just the weapon innacuracy or lack of rather. Haven't seen a game without it since Quake.
To me it's just one of those features thats been around so long and is necessary to any type of FPS game that it should be a simple .ini setting to control.
Posted: Mon Sep 05, 2005 9:46 pm
by AndyCR
i definitly agree. i dont know how g3d works, but in 3dgs it would be as simple as adjusting the bullet rotation slightly as it comes out of the gun, the amount depending on the accuracy setting, and propelling it forward normally... would even make it less accurate the longer the range (perfect for shotguns)... g3d shouldnt be very different.
(referring to in the actual rf codebase)
Posted: Sat Sep 10, 2005 3:11 pm
by Kamazy
Yea it should be easy to do don't know why it not there. It should be posible with scripting but i'm still a novice scripter so right now i'm scripting some simple players and enemies. Any way my game doesn't need weapons with accuracy cuz it's a arcade style tank buster witch should not be that hard to make after all this will be my first game EVER. And am really hoping to be a pro game maker.
Posted: Sun Sep 18, 2005 6:12 am
by ZenBudha
Yeah it's like a long lost feature or something. Perhaps it's impossible to do in RF without some huge code changes. Kind of like trying to fix the thing where you shoot a rocket in 4 directions, and in only two of them you see the explosion, etc.
Which must be the case because I've been seeking this feature since right after I first found RF and started playing with it.
The only solution so far is using two pawns but for the life of me I cannot get that to work.
It's really a bummer too like my 1920's gangster game idea. Now if I was just making it as a quick "concept" game it wouldn't matter. As in just a test for the game dynamics for use with a later better engine. However if I'm going to release a freeware game as a game. I'm not letting anything off my machine thats lacking fundamentals like weapon innacuracy. The 4 directions thing I can get around. No rocket or impact exploding grenade launchers, and decals show up in all 4 directions. So I can get bullet holes in things anyway so no big deal.
I've shot guns at all kinds of things in my lifetime and unless your firing tracer rounds a bullet hole and maybe some dust is about all the reaction you will ever see besides blood spray.
However how can you have a decent Tommy gun if it's a friggin laser? Then it becomes like those games that have pistols with perfect accuracy. You wind up using a beretta to snipe people at 300 yards.
Or in this case a Tommy gun which has the boasted accuracy of throwing a baseball.
About the only method I've used to come close to getting the feel of innacuracy is put up an innacurate crosshair according to the weapon. Other than a bullet hole decal give them no means of looking their shots in, and shake the screen like mad.
That way at least to play Tommy Gun sniper they have to kind of guess where the center of the crosshair is.
Anyway I'm not griping just a blog of sorts. I know the programmers are working hard on various things. I guess it all comes down to what the main vote on "Important" is. To me this is important but doesn't stack up their with a major feature like TnL.
I mean nobody lists "Realistic weapon innacuracy" next to their engine features.
Posted: Wed Sep 28, 2005 3:36 pm
by Kamazy
I know what you mean but this engine is made for 1st and 3rd person games and to me this should have been the first thing they added any way my game wont need this i just wanted to know if it was possible.
I think if i make a script with a random force it should work but i'm not looking in to that right now.And TNL and a phisiqes engine should be keeping them busy.
The thing i really wanted was to break down EveryThing in RF into scripts and allow people to edit everything from huds,weapons,players,bots,game mods etc... cuz i think thet the unreal engine uses this.Thats why so many unreal engine games came out.(brothers in arms,SWAT4,all unreal games) and many more.