Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Keltfire88

Pages: [1]
1
Modification Help / Re: Basic Weapon Help
« on: April 03, 2015, 07:16:11 PM »
Post your console log and/or the file.
Oh hang on, I figured it out. I stupidly put it in just the Blockland folder, not the Add-Ons folder.
Sorry about all the trouble guys, and thanks for your help! Locking

2
Modification Help / Re: Basic Weapon Help
« on: April 03, 2015, 05:34:05 PM »
What are the contents of your namecheck file?

Just a single line, the name of the weapon - "Weapon_AdvancedSword"

3
Modification Help / Re: Basic Weapon Help
« on: April 03, 2015, 01:57:25 PM »
What's your add-on directory called? Are you seeing any console errors related to it?

The add-on folder is just called Add-Ons. The problem is I never start up the server, because when I go to "Start a Server" --> "Custom" --> and look to where the addon should be (it's called "Weapon_AdvancedSword"), it's not there.

Do you have a description.txt in the .zip file? Add-ons won't show up if they do not contain a description.txt file

The description.txt file is usually for describing what an add-on does, but can be blank for testing purposes.

description.txt usually looks like this


Yes, I have a description.txt file. I also have a namecheck.txt file. My two .cs files are advancedSword.cs, which looks like this:

Code: [Select]
datablock ProjectileData(advancedSwordProjectile : swordProjectile)
{
directDamage = 50;

uiName = "Advanced Sword Slice";
};

datablock ItemData(advancedSwordItem : swordItem)
{
shapeFile = "Add-Ons/Weapon_Sword/sword.dts";

uiName = "Advanced Sword";

image = advancedSwordImage;
};

datablock ShapeBaseImageData(advancedSwordImage : swordImage)
{
shapeFile = "Add-Ons/Weapon_Sword/sword.dts";

item = advancedSwordItem;
projectile = advancedSwordProjectile;

stateTimeoutValue[0] = 0.8;

stateTimeoutValue[3] = 1;
};

and my server.cs file looks like this:

Code: [Select]
exec("./advancedSword.cs");

4
Modification Help / Re: Basic Weapon Help
« on: April 02, 2015, 02:15:03 PM »
Go into the add-ons menu before you start a server and click the circle next to it?

Oh that's what you mean. The problem was it wasn't even showing up in the list of addons in the first place, I thought you meant something I had to do in the code.

Code: [Select]
shapeFile = "AddOns/Weapon_Sword/sword.dts";
should be

Code: [Select]
shapeFile = "Add-Ons/Weapon_Sword/sword.dts";

I fixed that, but it's still not showing up in my list of addons. Any ideas?

5
Modification Help / Re: Basic Weapon Help
« on: April 01, 2015, 03:14:45 PM »
Yes, I have a server.cs file that executes it, but how do I enable it?

6
Modification Help / Basic Weapon Help
« on: April 01, 2015, 02:36:18 PM »
So I've got a basic weapon script. I'm using pretty much the same stuff as with the default sword weapon, with a few exceptions (more damage, slower fire rate). This is just so I can get used to scripting weapons, since I'm new to it. But I'm struggling, the addon isn't showing up in my addons list when I go to start a server, which I believe means there's a compiling error.

Code: [Select]
datablock ProjectileData(advancedSwordProjectile : swordProjectile)
{
directDamage = 50;

uiName = "Advanced Sword Slice";
};

datablock ItemData(advancedSwordItem : swordItem)
{
shapeFile = "AddOns/Weapon_Sword/sword.dts";

uiName = "Advanced Sword";

image = advancedSwordImage;
};

datablock ShapeBaseImageData(advancedSwordImage : swordImage)
{
shapeFile = "AddOns/Weapon_Sword/sword.dts";

item = advancedSwordItem;
projectile = advancedSwordProjectile;

stateTimeoutValue[0] = 0.8;

stateTimeoutValue[3] = 1;
};

7
Modification Help / Re: Scripting Weapons
« on: April 01, 2015, 02:34:13 PM »
I think I understand stateTimeoutValue, but I'm still confused on stateSequence. From what Headcrab Zombie said, it's used for animations, but are the animation files in the folder that the value of stateSequence is referring to? Or is it more like specified keywords that are used and then Blockland understands what to do from there.

8
Modification Help / Re: Scripting Weapons
« on: March 31, 2015, 09:31:39 PM »
You can't change them in tree(); - that's what I was saying here: Basically states need a server restart to apply the changes, and tweaking them to be just right can be an annoying process. Still, they're actually pretty self explanatory in how they work: The weapon is always in one state. It can transition to another state based on certain conditions, like triggerdown(when you click the mouse), timeout(after a certain amount of time), etc. The states do various things, like call scripts, play sounds, or attach emitters to the weapon. One of the most common scripts you'll see is in the fire state, onFire.

So a weapon might start with the activate state which plays the equip sound, after a split second switches to the ready state which waits for you to click the mouse, once you do it goes to the fire state which plays the effects and calls the onFire script, then to an idle state that causes a delay between shots, then in an automatic weapon might go right back to the ready state, or in semi-automatic may go to another state that waits for you to release the mouse that then goes back to ready.

Thanks, I did end up getting some help on the states topic in particular. Although there are a few specific ones that I still don't know what they do, like stateSequence and stateScript. Specifically with stateScript, I know that it calls a function, but how does it know what parameters to use when calling the function?

9
Modification Help / Re: Scripting Weapons
« on: March 30, 2015, 08:46:21 PM »
In the weapon image, there's a huge block of a bunch of arrays, stateSequence, stateTimeout, stateName, etc.

I can't explain them much cuz I've barely used them myself

Do you know where I could look more into that? I've been trying to search the forums and the internet in general but I can't find any resources that tells me more about those arrays. Experimenting with their values hasn't helped either, it doesn't seem to change anything.

10
Modification Help / Re: Scripting Weapons
« on: March 30, 2015, 02:27:51 PM »
You can use tree(); while running a server to open a menu where you can mess with them. If you know the name of the datablock you want to edit, you can also use inspect(NameOfDatablock);

Just tweak something, hit apply, use the weapon, and see what's different. The exception would be the weapon image datablock, which is a bit stubborn when the state fields are changed. If you want to ask about something specific, go ahead.

You might also check the engine documentation on datablock types, http://docs.garagegames.com/tge/official/content/documentation/Engine/Reference/structGameBaseData.html
It's not specific to Blockland so some stuff will be inaccurate, but it might help fill in some gaps.

Thanks! After experimenting with the tree(); method in the console, I've learned a lot. There are some certain factors I couldn't find though. For instance, how do I change the fire rate and animation rate of the weapon?

11
Modification Help / Re: More Inventory Slots
« on: March 28, 2015, 10:13:58 PM »
Remember to call the commandToClient AFTER the Parent::.

Why is it important to call the parent function first? Wouldn't the end result be the same?

12
Modification Help / Re: More Inventory Slots
« on: March 28, 2015, 08:43:09 PM »
Givnig it a second thought, that would only take effect the first time the client spawns. Try packaging a player spawn command.

Thanks! That seems to have worked. However, it only works if I respawn; if I use the changeDatablock event (hence, I don't respawn), it doesn't work. Is there any way to fix this?

13
Modification Help / Re: More Inventory Slots
« on: March 28, 2015, 08:05:30 PM »
Since it's a commandToClient to update the player's max tools, it should go in a packaged OnClientEnterGame().

Alright, here's the updated server.cs
Code: [Select]
package updateRPGPlayer
{
function GameConnection::onClientEnterGame(%client)
{
commandToClient(%client, 'PlayGui_CreateToolHud', %datablock.maxTools);
Parent::onClientEnterGame(%client);
}
};

exec("./RPGPlayer.cs");
activatePackage(updateRPGPlayer);

The problem I was having before is still there, it doesn't seem to have changed anything.

14
Modification Help / Re: More Inventory Slots
« on: March 28, 2015, 10:51:02 AM »
I also believe you have to send a command to the client when their datablock is set to that to fix their inventory slot count.

I believe the command is something like commandToClient(%client,'PlayGui_CreateToolHud',%datablock.maxTools);

Would that command go inside the server.cs file or inside the datablock itself?

15
Modification Help / More Inventory Slots
« on: March 27, 2015, 08:22:23 PM »
So I made a new player datablock that has 12 inventory slots instead of the default 5, but the inventory slots aren't showing up on the screen. I think that the slots are there, because I can pick up an item when my inventory is full, the only problem is the item doesn't show up.

This is RPGPlayer.cs
Code: [Select]
datablock PlayerData(PlayerRPG : PlayerStandardArmor)
{
miniJetEnergy = 0;
jetEnergyDrain = 0;
canJet = 0;

uiName = "RPG Player";
showEnergyBar = false;
maxTools = 12;
maxWeapons = 12;
};

Then this is server.cs
Code: [Select]
exec("./RPGPlayer.cs");

Pages: [1]