Scripting Question Adding upgradable weapons...

Inteck

First time out of the vault
How do you manipulate the scripting of the four individuals which can upgrade equipment. I would very much like the scripts to recognize and upgrade FAR more than the standard weapons which came with the game.
As you have probably guessed, I am currently adding NOT simply replacing a LOT of hardware to the game (mainly weapons) using F2Wedit by Cubik. Most of this hardware can be upgraded, and I am at a loss on how to do this with the 4 known individuals scripts. I am making a guess that the files in question which contain the info are (from "official" mapper scripts)

ncEldrid
vcmainwk
NCALGERN
GCSKEETR

If anyone could point me in the direction of a step by step tutorial or give me some solid information on how to modify these files to recognize more than just the stock weapons and their upgrades, and include my own which I am adding into the game, I would appreciate it.
Thanks in advance, Inteck
 
Hello there.
You need to do three things:
A) Make a suitable weapon proto
B) Register your new proto in COMMAND.H and ITEMPID.H headers
C) Use your new weapon pid in your scripts.

First of all make back up copies of the two headers.

Define your new weapon in the weapons section of ITEMPID header. Simply add them at the end of the raw. The number between brackets is the item proto number. Give your weapon a name which is easy to write down, this will save you a few headaches...

Toward the end of the COMMAND header you'll find a general macro to arm weapons. This will give your weapon the correct kind and quantity of ammo. You'll find something like this:
Code:
  (weapon_pid == PID_PLASMA_PISTOL) or                                 \
                        (weapon_pid == PID_PLASMA_PISTOL_EXT_CART) or                        \
                        (weapon_pid == PID_PHAZER) or                                        \
                        (weapon_pid == PID_YK32_PULSE_PISTOL) or                             \
                        (weapon_pid == PID_ALIEN_LASER_PISTOL) or                            \
                        (weapon_pid == PID_MAGNETO_LASER_PISTOL) or                          \
                        (weapon_pid == PID_ELECTRIC_GUN) or                                  \
                        (weapob_pid == PID_LASER_PEN)) then begin                            \
              stock_pid_qty(who_obj, PID_SMALL_ENERGY_CELL, ammo_qty)                        \

Double check the pid name... Watch out for the column of slashes. If your new slash is out of place then you won't be able to compile your scripts.
After that you'll be able to use the new weapon in your scripts.
I hope this helps, see you.
 
Something from my old experiments about upgrade weapons (maybe someone will find this usefull) I describled it in these tutorials (Polish version, but you can skip descriptions, see code) part1 and part2

How this work: I found unused part of script from obj_dude script which work that you change xander root and broc flower into healing powder, just when have them in inventory after enter any map (and succesfull test of skills) . This can be changed and used for self upgrade weapons (example: turn spear into sharpen spear)
 
Back
Top