2019-06-15 06:03:07

Hi yall,
So what I have been doing is making a game, no, i'm not asking this for cloning. If the subject is confusing, my question is, how do you make the weapons spawn on your map and make it draw the weapon in your inventory. I have all ready have number keys for weapons, and I want to add more. So what do I do to add more? As I said, i am not cloning games, I am making my game. So please help.

2019-06-15 08:17:44 (edited by kianoosh 2019-06-15 08:19:21)

My idea in your case usually is an array of a class named item or whatever you like, that has a name and an amount variable. So you handle it that way. In the loop that you check for if the player presses up/down move in the inventory, if thep layer pressed enter activate the item, you tell the game to draw a weapon, based on the item name. For instance, if the focused item is the b32 machinegun, I'd say play the drawing sound for the said gun, then draw it. Drawing the weapon is depended on your code, I can't comment something that won't confuse you about it unless I see your code. But about spawning weapons in a map. If you're coding an offline game, the simple thing is that whenever you load a map, you usually do clear all objects and previously spawned tiles and stuff alike. So there's no need of a mapname for your items. Items are of course classes. You either can use the same class as for your items in the inventory, by simpley setting the x/y/z variables in the item class, or you can code another one. Do it in any way you prefer and in the loop that you define for checking your spawned items state and stuff alike, usually named a checkloop in our open sourced games(specially mason's opensourced games), or the class name plus a loop word as the suffix so like itemloop, You check if the player's location is equal to the item's position that is right now being processed in your for loop, add an inventory item to the array we defined previously named as the same as the spawned item, and then remove the spawn item. Now your player can pick up items, and use them in their inventory, and I know this was a bit confusing because I'm probably not so good at explaning the ways of coding certain stuff yet because i'm not a native english speaker, Or you still need to practice to get a programming mind. A programming mind is one of the most important prerequisites for being able to code exactly(or possibly as near as possible to) what You want to have.

---
Co-founder of Sonorous Arts.
Check out Sonorous Arts on github: https://github.com/sonorous-arts/
my Discord: kianoosh.shakeri2#2988

2019-06-15 16:49:11

kiyanoosh. I remeber yoour ofline game in the any audio old times. You don't add weapon names. Why you ddon't releaset this game

2019-06-15 17:11:10

Have a super class named item. Then add weapon, as a subclass of item containing the required variables like fireing speed. To draw weapons, if item has an abstract function declaration named use, implement this function in weapon so the player draws a weapon. Then, for hotkeys, make the player use the weapon if she has it.

Roel
golfing in the kitchen

2019-06-15 18:44:13

I can give you code from a source

2019-06-15 20:00:43

I have a feiling that this lord guy is fighter 2005 aka Bilal

2019-06-15 20:42:40

@6, and you'd be absolutely right.

2019-06-15 20:48:23

my name is tommy, from German

2019-06-15 21:28:31

admins i'm saying it now publicly, and don't be angry:
i'm 100% sure, this lord, is fighter2005, same bilal ozchitak. Well his first name on anyaudio was lord2005 and his writting stile is looks like fighter2005's, so i'm sure he is.
Post 8 sure sure you are from German yeah.

Yours kindly

2019-06-15 21:56:58 (edited by Still_Standing 2019-06-15 22:00:04)

and you wanted to give him a code from a source, well, that just conferms it, you are bilal, no douts, the banned hamer  on you
oh, forgot, releaset , no wonders     many people have the same spelling error, oh yeah

And as anyone who's gone mountain climbing knows ,The serene snow-covered peaks that look so tranquil from a bdistance, Are the deadliest
sound is my vision
i rarely check my private messages on the forum, so if you want to contact me please use my email, or dm me  at oussama40121 on tw

2019-06-15 21:59:06

woopsy post 10 will personal attack i guess. Well probably admins will look here and probably they will do truth act about him.

Yours kindly

2019-06-15 23:05:06

@8, then please explain why your writing style looks like of bilal ozsitak? The one that was banned here some time ago?
that bilal also likes to type: startet, releaset, uptatet, etc. Just like you.
Admins just need to check his ip and location, etc etc.

2019-06-15 23:26:54

heh reply in german language 8 so you can convince them.

2019-06-15 23:50:27

@13 there is google translate

2019-06-16 02:37:56 (edited by Ethin 2019-06-16 02:38:47)

@14, google translate is not that bad at English. It will do started, released, updated, ...; it won't misspell words. I've seen it break the grammatical rules of English but never misspell a word.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2019-06-16 09:03:38

google tranlation never, never mis spell a word

And as anyone who's gone mountain climbing knows ,The serene snow-covered peaks that look so tranquil from a bdistance, Are the deadliest
sound is my vision
i rarely check my private messages on the forum, so if you want to contact me please use my email, or dm me  at oussama40121 on tw

2019-06-16 10:19:56

well check his ip, location, like crazygamer's one. And yeah google translate have some problems with grammarly translating, but it never will translate mis spell words.

Yours kindly

2019-06-16 16:24:28

And you would think he could spell his own country if need be. I'm from german, that's like saying I'm from english smile

We are pleased, that you made it through the final challenge, where we pretended we were going to murder you. We are throwing a party in honor of your tremendous success. Place the device on the ground, then lay on your stomach with your arms at your sides. A party associate will arrive shortly to collect you for your party. Assume the party submission position or you will miss the party.

2019-06-16 17:31:13

Ok, let's look at it like this. the last like 10 or more posts does not even tell the person how to add weapons to the inventory. Why should every one always say some thing negative? so what if he is that fighter whatwhat, is there any thing you or we can do? no. we are not the admins of this forum. but make classes with an array or a list or what ever language you are using, loop through the array and select or draw the weapon from the inventory the same way you look at which key is pressed to draw a weapon. hope i am clear

best regards
never give up on what ever you are doing.

2019-06-17 00:24:41

Lord, do tell me something, if you can.

If you're German, then why are you making the same spelling mistakes as someone who, I believe, speaks Arabic? I could get into specifics, but I suspect it will go over your head.
More interestingly: why is it that when I attempt to geolocate your IP address, you're in Turkey?

Check out my Manamon text walkthrough at the following link:
https://www.dropbox.com/s/z8ls3rc3f4mkb … n.txt?dl=1

2019-06-17 00:56:59 (edited by mazen 2019-06-17 00:58:16)

No he speaks Turkish and he is from Turkey.  And also fighter 2005 is from   Turkey. Pluss, his spelling is like fighter2005
He doesn’t speak arabic though

2019-06-17 01:46:46

Oh. My apologies then, regarding the language issue. Are Turkish and Arabic similar?

Check out my Manamon text walkthrough at the following link:
https://www.dropbox.com/s/z8ls3rc3f4mkb … n.txt?dl=1

2019-06-17 02:46:15

.Use an array

2019-06-17 03:32:31

Jayde wrote:

Oh. My apologies then, regarding the language issue. Are Turkish and Arabic similar?

Nope. There some words that are the same but still its way way  different

2019-06-17 08:54:03

post 22, nope,  they aren't, maybe some words but they are diffrent

And as anyone who's gone mountain climbing knows ,The serene snow-covered peaks that look so tranquil from a bdistance, Are the deadliest
sound is my vision
i rarely check my private messages on the forum, so if you want to contact me please use my email, or dm me  at oussama40121 on tw