HeroEngine Forums
Welcome, Guest. Please login or Register for HeroCloud Account.

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.

Topics - LastJudge

Pages: [1]
1
Scripting & Programming / [Resolved] Spec within a spec
« on: Apr 21, 12, 03:47:28 AM »
I'm working on item system right now and I'm wondering about some things.

What is better, making an enum which contains equip locations, or make a separate spec for them? If it's the second one, how do I make a spec contain another spec?

Also I want to make a field which will remember item's rarity (common, uncommon, rare, ... ). I'd probably like to make it as a spec so I can assign item color to rarity as well.

Thx for any suggestion :)

2
GUI Creation / [Resolved] Size-based Inventory System
« on: Apr 18, 12, 09:59:34 AM »
So, I want to make an inventory that will take item's size into account. Something like diablo, mu online and many other games did.

Here's what I want to achieve:

What I figured is I have to make the item remember it's width and height. The problem I face is how to make inventory remember it's position, I originally wanted to make it remember the top left corner of an item and then use it's size to calculate where it is, but I wonder if there is a better approach. Maybe make every inventory slot remember the item ID of an item that's partially there?

Any hints and ideas are welcome :)

3
Developer Hero Projects / Rest in Pieces: the Fourth Legacy
« on: Apr 01, 12, 05:25:42 AM »


Name: Rest in Pieces: the Fourth Legacy

Genre: RPG / FPS hybrid

Playable Races: Human, Cyborg

NPC Races: Dragon, Mechanized (steampunk style), Demon, Angel, Mutant

Classes: Juggernaut, Avenger, Deathdealer, Rifleman, Medic

Professions: Armortech, Weapontech, Bio-Surgery, Scrapfinding, Bombmaker

Story: Most of Earth's resources were gone by the year 2154 so humans decided to leave it and find a new host. People lived in an enormous spaceship called "The Last Haven" and pludered other planets to keep themselves alive. After years of abandonment, the earth's ecosystem seemed to have recreated itself so they decided to come back to Earth again. But during 666 years of Earth's abandonment "the Elders" reclaimed it for themselves. All sorts of ancient creatures and races emerged and inhabit the earth once again. You are a mercenary hired by people to destroy or harness the life on the planet and enable to live on the planet peacefully.

Screenshots:

As we want to make sure that player won't be able to benefit from using bots to farm for them, we came up with a solution:



We are also working very closely with the guys at ReCapthcha to deliver the best possible experience. As we want the game to have an authentic feeling, we will be using an alternative capthcha for Cyborg players:



We finished basic achievement system and we even decided to make some achievements depend on the game time. This one can only be obtained between 0130 and 0200 (game client time):

4
Developer Created Tutorials / Hint: mouse target self
« on: Jan 22, 12, 04:59:19 PM »
This more of a little tip than a tutorial. In clean game you can only target yourself by pressing 'Tab' key, which makes you target nearest target. If you want to be able to click on your character to target it, just follow these few simple steps.


1. Open server scripted named E_InputHandlerClassMethods


2. In the method HE_PreContextMenuServerMouseEvent add following line after the first if statement. So this
Code: [Select]
  if targets.length > 0
    target = targets[1]
    Debug( "Found target: " + target + "." )
    if target == None
      // no target, so clear targeting
      source.SetClickTarget( 0 )
      call client source %E_TargetCircle.E_UpdateTargetCircle( 0 )
      return true
    .
  else
    Debug( "No heroic targets found." )
    target = mEvent.MouseTarget
    if target == None
    // no target, so clear targeting
      source.SetClickTarget( 0 )
      call client source %E_TargetCircle.E_UpdateTargetCircle( 0 )
      return true
    .
    Debug( "Found game target: " + target + "." )
  .
will look like this
 
Code: [Select]
if targets.length > 0
    target = targets[1]
    Debug( "Found target: " + target + "." )
    if target == None
      // no target, so clear targeting
      source.SetClickTarget( 0 )
      call client source %E_TargetCircle.E_UpdateTargetCircle( 0 )
      return true
    .
  else
    Debug( "No heroic targets found." )
    target = mEvent.MouseTarget
    if target == None
    // no target, so clear targeting
      source.SetClickTarget( 0 )
      call client source %E_TargetCircle.E_UpdateTargetCircle( 0 )
      return true
    .
    Debug( "Found game target: " + target + "." )
  .
  if target = source
  // target self
    call client source %E_TargetCircle.E_UpdateTargetCircle(target)
    return true
  .

Compile, Submit, Close


3. Logout and log back in. That's it, it should work now.

5
Developer Created Tutorials / Simple mana system
« on: Jan 21, 12, 05:17:31 PM »
Time for another tutorial :)

I'm only going to make it very simple, you can expand it to fit your needs. I am going to cover adding new attribute to character which will be used to cast spells and also make spells use it, I'm not going to cover adding this new attribute to your status bar (I might do a status bar tutorial later, but I don't think it's needed).

Note: I did not actually test this tutorial. I am using a bit more complex system that is specific to my game. So if something doesn't work as intended, just tell me and I'll try and fix it.

1. Let's add mana to our character
Open DOM Editor: Windows -> DOM Editor
Add new field to the client side. Call it E_manaPoints and make it an integer.



2. Copy it to server.


3. Go to Server DOM, click on your E_manaPoints field and set Destination Field (client) to "E_manaPoints" and set Delta Priority to 1. Also set Change Callback to true (even though it's not changed to that value in the picture).

Note: You should have E_manaPoints instead if TS_powerPoints.


4. Now let's add our field to character. Find E_CommonCharacter in client DOM. Add new field and choose E_manaPoints, click the Save button.



5. Do the same for E_CommonCharacter in server DOM and also check the 'R' checkbox (it indicates that this field is going to be replicated), click the Save button. That's it for clicking, it's time to write some code now.

Note: Yours should be named E_manaPoints


6. Open E_CommonCharacterClassMethods server script. In the InitCommonChatacter() method, we will need to add an initial value for mana. Modify this
Code: [Select]
  me.E_hitPoints = 100
  me.E_isDead = false
to
Code: [Select]
  me.E_hitPoints = 100
  me.E_manaPoints = 100
  me.E_isDead = false

We also need to add a method that will allow us to modify mana upon casting a spell.
Code: [Select]
method AdjustMana(manaDelta as Integer, ability as NodeRef of Class E_Ability)
  me.E_manaPoints = MiscUtils:Min(me.E_manaPoints + manaDelta, me.E_manaPoints) 
.

Find the ApplyDeath method and modify it so character won't have mana when dead. Modify this
Code: [Select]
me.E_isDead = true
me.E_hitPoints = 0
to
Code: [Select]
me.E_isDead = true
me.E_hitPoints = 0
me.E_manaPoints = 0

Find ApplyLife method and modify this
Code: [Select]
me.E_hitPoints = 100to this
Code: [Select]
me.E_hitPoints = 100
me.E_manaPoints = 100

Find E_RegenTimer_tick() method and add a new line like this
Code: [Select]
me.E_manaPoints = MiscUtils:Min(me.E_manaPoints + 10, 100)Note: In case you already did the "combat tutorial" you might want to have different regeneration values for when the character is in combat and different when out of combat.

We're done with this script, so click "Compile" and then "Submit" and close the script.


7. Open server script called E_playerCharacterClassMethods, locate the ProcessXPGain() method and modify this
Code: [Select]
me.E_hitPoints = 100to this
Code: [Select]
me.E_hitPoints = 100
me.E_manaPoints = 100

Compile and Submit the script and close it afterwards.


8. Open server script called E_CharacterCreationSystemClassMethods. Find the HE_CCSCharacterActivated method and modify this
Code: [Select]
char.E_hitPoints = 100to this
Code: [Select]
char.E_hitPoints = 100
char.E_manaPoints = 100

Compile, Submit, Close ...


9. Now we are going to modify the ability scripts so they use mana too. I'm not going to write code for each of those scripts as it's pretty much the same for each of them. Now as abWeaponStrike and abSwipe are kinda basic attacks, we won't modify these (but you can of course, it's up to you).

Open abFireball server script (repeat for abHeal and abRubyFire too)
add function for getting a mana cost
Code: [Select]
shared function GetManaCost() as Integer
  return 50
.
Note: replace 50 with any number you see fit as the cost. Remember we have set 100 as maximum mana, so it would be nice to keep this number lower than that.

Now we need to modify ApplyEffects function to look like this
Code: [Select]
shared function ApplyEffects( owner as NodeRef of Class E_CommonCharacter, target as NodeRef, ability as NodeRef of Class E_Ability )
cost as Integer = GetManaCost()
  if (owner.E_manaPoints >= cost)
    abEffects:ApplyDirectDamage( owner, target, ability, GetMinDamage(), GetMaxDamage() )
    owner.AdjustMana(-cost, ability)
  .
.


10. We should have a working mana system now. Just make sure to add a mana gauge to your status bar or otherwise you won't be able to see how much mana you have.

6
Developer Created Tutorials / Simple ability cooldown display
« on: Jan 08, 12, 04:11:53 PM »
Now we are gonna make a cooldown display for abilities

What we are trying to achieve:



1. We need to add a label above ability icon and delete the abilityShutter (you can still use it if you want to but I don't think it's necessary anymore as we are going to have cooldown shown by numbers.



2. Now we change position and properties
visible = False (we don't want it to be visible normally)
name = abilityCooldownLabel
scale =   ... this is up you, use whatever scale you feel is appropriate
autoCenter = True, True (so our label is always in the middle)
text =    ... I use a number here to actually see where my text will be shown
displayfont = ... use any font you feel is appropriate




Save the xml and close it afterwards.


3. Now we need to create a GUI animation to make this thing work. Open DOM editor and create a new client class. Call it GUIA_Cooldown.
Name: GUIA_Cooldown
Archetype: data
Field: timeIndex


And now we'll need to do the coding part.

7
Developer Created Tutorials / Simple ability tooltip window
« on: Jan 08, 12, 12:20:55 PM »
Making a simple ability tooltip window

What we are trying to achieve:



1. First thing we do is create a new class for the tooltip window.
Name: MY_AbilityTooltip (you can use your prefix instead of MY)
Archetype: guicontrol
Parent Class: GUIPanel




2. Create a new GUI prototype
Name: MY_AbilityTooltip
Inherit from: _panel
Class: MY_AbilityTooltip



3. Resize your panel, add some labels
This is how I did mine

Note: In the screenshot there is TS_AbilityTooltip as TS is prefix I use for my game, you should have MY_AbilityTooltip instead or whatever your prefix is.
Note 2: There are a lot of panels in mine, as I needed them for borders and corners (I'm not gonna walk you through borders, open _button to see how they are done). All my labels are located inside panel named 'background'


4. As we don't need to change any default values of panels and labels (besides color, texture, font, and size) we can go on  and write our code.


8
GUI Creation / [Solved] GUI lag
« on: Jan 05, 12, 04:23:21 AM »
I'm trying to make my own GUI. So far I have created a new window and also the ability bar. The ability bar is still the same from the clean engine with changed textures (I'm using DXT5 texture). It's working, I have no problem with clicking on abilities and using them, but the moment I move my mouse onto GUI, my framerate drops drastically (from around 160fps to 20-30fps).

Does anyone have an idea what the problem can be?

9
Off Topic / Merry Xmas
« on: Dec 24, 11, 12:08:00 PM »
Merry Christmas everyone. Enjoy it in peace and joy :)

Pages: [1]