Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Easy FPS Editor CE v1.10.5

A free tool for creating oldschool FPS games · By Clark

stupid question: Same Ammo for two different Weapons

A topic by Wasteland Industries created 87 days ago Views: 305 Replies: 7
Viewing posts 1 to 3

sorry for my dumb question, but it seems to me that each weapon requires its own ammo, can two weapons share the same type of ammo, for example a shotgun and a double barrel shotgun?
I'm sure the answer is obvious but it escapes me so far.

(9 edits)

Yes, they can - you can use a tiny (map_loop.script) to share current-ammo between different weapons.
eg- this shares ammo between "weapon 3" and "weapon 5" in my game:

player check heldweapon global.heldweapon

if $global.heldweapon == 3 {
player check ammo 3 global.weapon3ammo
take ammo 5
give ammo 5 $global.weapon3ammo
}

if $global.heldweapon == 5 {
player check ammo 5 global.weapon5ammo
take ammo 3
give ammo 3 $global.weapon5ammo
}

Here's a video of it in action...the "gun" and the "zoomed-gun" are actually 2 different weapons sharing the same ammo
https://dai.ly/k3DKagrsOzAFqIH4USy

(1 edit) (+1)

Thank you for the script VP, here's another question: how do I get a "you need a blue key to open this door" message?

(4 edits)

You're welcome!
For a door message: you just need a $variable (to check if the blue key is held or not). Then a "hud text key" line to display the message.
Here's the HUD-text explanation from the git-hub help-file...
hud text (hud text [name] [string] [font size] [x] [y] [r] [g] [b] [layer] [alignment: left/center/right])
*you could  use "hud image" instead (if you want a graphical bitmap image instead of plain-text) - or both. https://www.dailymotion.com/video/x9p33k0


a map._loop.script example would be...

if $map.bluekey == 0 {
hud text bluekey "You need a blue key!" 16 0.051 0.06 215 215 215 2 left
}
if $map.bluekey == 1{
hud text bluekey "The blue key unlocked the door!" 16 0.051 0.06 215 215 215 2 left
}


You just now need to set a variable when the key is collected. In a decoration script (for the bluekey) just add:
map.bluekey = 1

So now when you pick up the key, it sets the bluekey variable to 1.
Also, in map.script (not the map_loop.script) add:
map.bluekey = 0
so when you start the game, you don't have the key,

(+1)

wow, thanks again, I'm no programmer and this looks like sorcery to me. The obvious question is why isn't all this stuff build-in into the engine gui so that anyone can tinker with them in the menus.

(6 edits)

No problem :) 

Yeah, it does take a bit of getting used to - there are 3 main answers to your "built-in features" question:

1- This CE version (Clark Edition) is a project fork to improve the old/outdated project so the basis was already set by someone else.
2- Clark realised it would be better to make a new game-engine (EZGB), with way more features - but it's not finished yet (he wants to fix all EFPSE bugs first). https://cg8516.itch.io/ezgb
3- The nature of games is so diverse that not everything can be a built-in feature - scripting allows for creativity by adding your own non-standard features as required (eg: leaning/sprinting/weapon-cool downs/dialogues/fetch quests/ladders/elevators/power-ups/load-outs/skill-trees/swimming in water/floating in space/shrinking like ant-man/swinging from ropes/gravity guns/portals/teleports/enemy knock back/blood-spatters/mini-games/save-points/weapon upgrades/point-n-click puzzles/video sequences/camera shakes etc.

The original ethos being: restriction breeds creativity.

If it's too complicated for you at the moment though, you can join the discord servers (linked in the download page), I'm sure people will be happy to write/add scripts/features for you - some good people there who like a challenge if you feed them your ideas. I'd say almost anything is possible with this engine.

There is also a (much) simpler way of displaying a text message when you interact with a decoration/enemy..
Create a text.txt document and rename it as .script (file extension) with exactly the same filename as the decoration/enemy (eg: bluedoor.script).
Now in that bluedoor.script file (open it as a text file) just add the line :
text You need the blue key to open this door!

..when you run the game and click (press 'E') on the decoration/enemy, it will display the message. (I think this will work with enemies and decorations - I just don't think it will work for doors).

(+1)

I'm finishing my first EFPSE prototype and I can't wait to delve into the more complicated stuff for the next games!

That's great! I wish you the best of luck with your projects. Something worthy of note (you probably already know) - there are updated dev-builds available (download from here)... https://github.com/CG8516/DumpingGround/tree/main/EFPSE_DEVBUILDS

They have quite a lot more features than the original builds found on itch.io (the updates are explained in the text on the github page) but you MUST backup your project first = because if you open an old project with a new engine-version... the project gets patched to the newer version and there is no way to open it again in an older version (unless you restore then old engine and project from a zip/backup)!!

My advice is - finish the project you're working on first - then when you start a new project, try a new engine-build (I'm using the current bugtest5 version from 2 months ago, it has some great new scripting commands). To use a newer version - back up your old one (zip/7z the project folder) copy/paste the new_engine.exe in the project folder and run it - it will patch the project files.

You may find that really old projects wont run/function in newer versions (especially maps and scripts/states)- so it's probably best to start a new project from scratch. (I was forced to abandon my first project after years of work - despite having several backups of it).

I imagine the final build/version of EFPSE-CE will probably (possibly) be released later this year, so you could just wait for the final version to mitigate any potential future compatibility issues altogether.