Cant get actor spout to work for breaking window.

Post topics regarding Level Building/Design and Entity Usage with Reality Factory
Post Reply
incenseman2003
Posts: 320
Joined: Sat Mar 11, 2006 11:41 pm

Cant get actor spout to work for breaking window.

Post by incenseman2003 »

I have been slamming away at this for some time. I have tried to get it on my own. I need a window to break and have the glass fall down and stay there. As it stands I can get the window to vanish when shot. Thats as far as I have gotten. I have gone through the forums and found that people have the same issue. All that others have said is "Use the actor spout". Thats a great idea. Is there anyone that can tell me, in detail, how to do that?
Patience and tolerance are the keys to the passage of knowledge. Even those that are the most knowledgeable started with many questions.
User avatar
Juutis
Posts: 1511
Joined: Thu Jan 12, 2006 12:46 pm
Location: Finland

Post by Juutis »

I assume you are using a DestroyableModel to make a world model destroyable, or... ?

Well anyway, first you'll need to model some sort of pieces of glass and compile them to actors. Put all the compiled actors to the same folder, like actors\glass, and name them 'glass0.act', 'glass1.act', 'glass2.act' etc...
I think 3 different actors (3 different shapes of broken glass) is enough, but of course you can add as many as you want. Then open up the level editor and add an ActorSpout entity near the window that you want to break. The main fields you need to set are:

BaseName - With the names above this would be 'glass\glass'
NumActors - The number of different actors you have
Style - See the 'ActorSpout' section in the manual to see different settings, I would use 2 so the actors are randomly picked
ParticleCreationRate - How fast the actors are created. Something like 0.01 is good so it looks like a bunch of actors are created immediately
TotalLife - How long will the entity keep creating actors. With 0.1 and ParticleCreationRate of 0.01 the entity would produce 10 pieces of glass.

But now the most important thing. Setting up the trigger.
Select your DestroyableModel entity and set szEntityName to 'window_destroyed'. Then add a LogicGate Entity and use these settings:

szEntityName - window_trigger
Type - 2
Trigger1Name - window_destroyed

You can see what can be done with different settings in the manual. In the section 'Trigger and LogicGate Entities' there's a good explanation of these things.

Then one last thing. Select the ActorSpout entity and set 'Trigger' to 'window_trigger'.



That's pretty much it... feel free to ask if you have any questions.
Pain is only psychological.
incenseman2003
Posts: 320
Joined: Sat Mar 11, 2006 11:41 pm

Post by incenseman2003 »

Thanks for the tip, I will try that.

There is another thing that I need some info on. Wonder if you can help.

I was taking damage to my player whenever I fired a weapon like the minigun or such. I tried playing with the bounding box size and that fixed the damage issue but then I was having my player go halfway into a wall so I put that back. I then played with the weapon position and that fixed it to but it looked really bad so I put that back. then I renamed the players health in the player.ini to read as such:

; ActHealth

[acthealth]
initial = 100
low = 0
high = 100


And I changed it in the robot.s (that is the script Im using) to read as such:

DAMAGEATTRIBUTE [acthealth] // attribute damaged by attack



I then renamed it in the hud.ini to read as such:

[acthealth]
type = horizontal
frame = hud\hud_health_oxygen.bmp
framealpha = hud\a_hud_health.bmp
indicator = hud\hud_health_oxygeni.bmp
indicatoralpha = hud\a_hud_healthi.bmp
framex = 10
framey = 10
indicatoroffsetx = 75
indicatoroffsety = 0
indicatorwidth = 160

Now when I fire the weapon I dont take damage from my own weapon. I can kill the robots but they cant kill me. the health on the health meter goes down but I dont take damage at all. Is there something else I need to change?
Patience and tolerance are the keys to the passage of knowledge. Even those that are the most knowledgeable started with many questions.
GD1
Posts: 413
Joined: Tue Jul 05, 2005 2:33 pm

Post by GD1 »

the word HEALTH is hardcoded into the engine. when it reaches 0, you die. you cannot change this.

a lot of people have this prob with weapons. you have to change the "playerlaunchoffset" and "viewlaunchoffset" of the weapon in weapon.ini, that's all there is to it. as long as the offset is outside the players BBox you should be fine.
Check out my band
Tougher Than Fort Knox
Image
incenseman2003
Posts: 320
Joined: Sat Mar 11, 2006 11:41 pm

Post by incenseman2003 »

Thanks,

Its not what I was hoping for but I am greatfull for the input.

I'll just work with it the best I can.
Patience and tolerance are the keys to the passage of knowledge. Even those that are the most knowledgeable started with many questions.
User avatar
QuestOfDreams
Site Admin
Posts: 1520
Joined: Sun Jul 03, 2005 11:12 pm
Location: Austria
Contact:

Post by QuestOfDreams »

change the damage attribute of the players weapon to "enemyhealth", give your enemies the health attribute "enemyhealth", give the enemies' weapons the damage attribute "health" (if they should be able to damage each other set the alternate damage attribute to "enemyhealth") - voila
incenseman2003
Posts: 320
Joined: Sat Mar 11, 2006 11:41 pm

Post by incenseman2003 »

QuestOfDreams,

thanks for the good advise. I made the changes that you suggested but didnt get the results I was looking for. When I did that the windows did not break when I shot them. I then changed the "health" for the destroyable model for the windows to "enemy_health" (The same as the weapon.ini). Now I can kill the robots and they can kill me and the windows break when shot.

thanks for leading me in the right direction people.

Edit: 11:04 AM 9/15/2006
I have 2 windows in my game. One above the other. They are both breakable and broken glass spawns in and falls to the ground. However! When I shoot the upper window the broken glass from it will not fall past the top of the bottom window until the bottom window is broken. Then the broken glass from both fall to the ground.

I have another upper window that is also breakable but not above another window and it works fine.

Is there a way to get the glass from the upper window to fall all the way to the ground, or is this a bug that I am going to have to try to work past somehow?

Edit- 9:39 AM 10/10/2006:
I have found that if I stagger the windows and not make the building more than 2 stories high that fixes the issue. I would like to have buildings more the 2 stories high, but then I want a billion dollars to. LOL

It just seems that until Reality factory is ready to do some of the simpler things we will have to work around some stuff.

Oh well. Its good practice for when the program matures.

Have a great day.
Patience and tolerance are the keys to the passage of knowledge. Even those that are the most knowledgeable started with many questions.
Post Reply