View unanswered posts | View active topics It is currently Fri Apr 19, 2024 3:17 pm



Reply to topic  [ 7 posts ] 
 Some questions regarding an unusual actor 
Author Message
User avatar

Joined: Thu Jan 01, 2009 5:35 am
Posts: 11
Reply with quote
Post Some questions regarding an unusual actor
I've made a few actors before, but nothing too different from the usual human re-skin. Nothing that I thought was worth releasing or finishing.

Now though, I wanted to make something worth sharing. I've started on making a true alien faction, and this is the first unit:

Image

That's what it should look like anyway. A one legged robot Ahuman. Right now it looks more like this:



Things that may be important to know:

- The arms and hands should be invisible. This is meant to create an illusion that the guns themselves are the arms.

- What looks like the body is actually its head. This allows it to look wherever it is firing.

- It dual wields modified dummy blasters, but can also switch to a melee weapon (modified Ronin shovel currently).


I would appreciate anyone who can help with any of the following problems:


- The unit should not be able to drop it's guns or pick up new ones. I'd prefer that it could still switch to a melee weapon (also un-droppable.)

- Instead of flying by jetpack, it should jump. I can make it jump instead of fly, but is it possible to make this depend on whether it still has its leg or not? It should be immobile if it loses its single leg.

- I can't seem to position the arms/hands/guns so that they look properly attached by the shoulders. Instead they're just kinda floating in front of the torso.

- The foot isn't attached correctly either. it's sunken into the floor and isn't always attached in the right position as it walks.

- (If this is even possible) The hole in the center of the Hopper robot is meant to be a third weapon. It should fire something similar to the dummy destroyer cannon's slow moving ball. I'm wondering if one of the two dual wielded blasters could be given an alt-fire mode for this purpose? I'm not picky about the energy ball looking like it comes from the gun rather than the torso.


I notice that the smoke from the weapons are behind the guns for some reason, but I haven't even tried fixing that yet.


Mon Jul 16, 2012 8:21 am
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Tue May 25, 2010 8:27 pm
Posts: 4521
Location: Constant motion
Reply with quote
Post Re: Some questions regarding an unusual actor
Jager_57 wrote:
- The unit should not be able to drop it's guns or pick up new ones.
- Instead of flying by jetpack, it should jump.
- I can't seem to position the arms/hands/guns so that they look properly attached by the shoulders.
- The foot isn't attached correctly either.
- The hole in the center of the Hopper robot is meant to be a third weapon.

1. What you'd have to do here is script the guns to delete themselves whenever they're dropped, then script the actor to check its inventory for those two weapons and if they aren't there, re-add them.
2. Because we can check attachables and whatnot now, you should be able to detect the presence of the leg via Lua again, then gib the jetpack (jumping) if it isn't there.
3. Offsets are a tricky beast to tame. Alter the arm/hand offset variables until it goes the way you want it to.
4. Again, more offsets, as I'm sure you know.
5. Here you can use the actor's script to create the round when the fire button is pressed, but it's more complicated to have it aim properly.


Mon Jul 16, 2012 12:38 pm
Profile
User avatar

Joined: Thu Jan 01, 2009 5:35 am
Posts: 11
Reply with quote
Post Re: Some questions regarding an unusual actor
I remember seeing a Lua script posted somewhere that would re-add a gun if it were dropped. I'm worried that this will cause the actor's guns to respawn every time they're destroyed though. Looks like I'll need to learn Lua. I'll be able to fix #2 at least.
Although, it should be possible to make the gun invisible and use its sprite for the arms. That way the respawning would not be an issue since the arms could be blown off instead. It creates a different problem though, because the melee weapon either won't have its own sprite, or it will look like there are two weapons held at once.

It didn't seem like anything I did to alter the hand or arm offsets changed anything. I'll keep working on the offset problems though. There must be something I forgot to try. I gave up early on the foot because the arms were giving me so much trouble.

As for the last one, I don't want it to fire at the same time as the guns. It should fire separately without having to switch to a different weapon. Using a different weapon for this would be OK if it didn't mess with the dual wielding.
I could try making the guns have two types of ammo though using the pie menu, like the grenade launcher. It's not exactly an alt-fire button but it works. I guess this solves that problem.


Tue Jul 17, 2012 5:03 am
Profile

Joined: Fri Jul 06, 2012 7:20 am
Posts: 44
Reply with quote
Post Re: Some questions regarding an unusual actor
This is an actor-based script. I assume you know how to set an actor's script.

Make a boolean variable called self.MakeGun in the create event.
In the update event, put this code.

Code:
if (self:GetController():IsState(20) == true) then -- maybe check which weapon it is, and use a different boolean for each?
     self.MakeGun = true
end

if (self.MakeGun == true) then --probly other conditions too.
                               --You may also want to make a different variable for the melee weapon.
                               --I may be convince-able to help in that regard if I can, but I'm feeling lazy right now.
    -- put the gun in yo' inventory
    self.MakeGun = false
end

http://wiki.datarealms.com/LuaDocs/Cont ... ntrolState

This check will tell you if the player dropped the gun so that it won't remake it if it gets blow'd up.

If you don't understand this, you may want to just learn Lua yourself.


Wed Jul 18, 2012 1:54 am
Profile

Joined: Fri Sep 10, 2010 1:48 am
Posts: 666
Location: Halifax, Canada
Reply with quote
Post Re: Some questions regarding an unusual actor
I think you forgot to make and add the gun there Visage.
Add the line self:AddInventoryItem(CreateHDFirearm("gun name" , "your rte.rte")); anywhere after if self.MakeGun == true.

Also Visage, for the convenience of anyone else reading your scripts I'd suggest using the named enumerations of controlstate (and other states) since having to go to the list and find what 20 is is kind of inconvenient. Also it seems counter-intuitive since unless you memorize the list you'll probably have to check it up whenever you want to do it anyway. Obviously it's up to you though.


Also, while I'm here, another way of doing it that'll also delete any other weapons and doesn't require anything in the Create function. Untested so I can't say for sure it won't spawn multiple weapons (might want to put a check similar to Visage's in). Also it might pop out errors after deleting foreign objects, though hopefully it won't.
Code:
function Update(self)
   --If the actor has an equipped item
   if self.EquippedItem ~= nil then
      --If it's the gun, recreate if dropped
      if self.EquippedItem.PresetName == "gun name" then
         if self:GetController():IsState(Controller.WEAPON_DROP) then
             self:AddInventoryItem(CreateHDFirearm("gun name" , "your rte.rte"));
         end
      --If it's the melee weapon, recreate if dropped
      elseif self.EquippedItem.PresetName == "melee weapon name" then
         if self:GetController():IsState(Controller.WEAPON_DROP) then
             self:AddInventoryItem(CreateHDFirearm("melee weapon name" , "your rte.rte"));
         end
      --If it's neither, delete it
      elseif self.EquippedItem.PresetName ~= "gun name" and self.EquippedItem.PresetName ~= "melee weapon name" then
         self.EquippedItem.ToDelete = true
      end
   end
end


Wed Jul 18, 2012 5:29 am
Profile
User avatar

Joined: Thu Jan 01, 2009 5:35 am
Posts: 11
Reply with quote
Post Re: Some questions regarding an unusual actor
Thanks for the replies, and the scripts!

I haven't had as much time as I wanted this week to work on this actor. I'm still trying to get the offsets right. The foot doesn't seem capable of moving as far as I want it to. It's as if the leg sprite is too long, and the foot is bound by an invisible rope to the torso.


Thu Jul 19, 2012 8:35 am
Profile
DRL Developer
DRL Developer

Joined: Fri May 15, 2009 10:29 am
Posts: 4107
Location: Russia
Reply with quote
Post Re: Some questions regarding an unusual actor
Check out the offsets under where the foot/leg connection is defined in the .ini.


Fri Jul 27, 2012 6:14 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: Google [Bot]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.051s | 18 Queries | GZIP : Off ]