NewsUnrealEdFilesModsFragBULiandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 11th Nov 2001, 11:21 AM   #1
Postal
I apear to have lost my pin.
 
Postal's Avatar
 
Join Date: Nov. 14th, 1999
Posts: 1,388
Reload key

I want the guns in C4 to reload when you hit a key

but first when I tried Button bExtra3:
simulated function Tick(float DeltaTime)
{
if (Pawn(Owner) != None && Pawn(Owner).Weapon == self)
{
if (PlayerPawn(Owner).bExtra3 != 0)
{
GoToState('NewClip');
}
}
}

I got lotss of access nones, or something or another warning in the ut log

But when I when to using an exec function in the gun, sometime after a while in game it stops working.

What do you all suggest?
__________________

Peace through superior firepower.
Postal is offline   Reply With Quote
Old 11th Nov 2001, 02:07 PM   #2
2COOL4-U
Registered User
 
Join Date: Mar. 17th, 2001
Location: dot NL
Posts: 505
could it be that the animations are not done for the weapons you want to reload, I think we here at Defence Alliance had a problem with no animations while the base weapon class was trying to play them, after that happend I couldn't do anything at all with the weapons until I killall'ed the weapon
__________________
Jeroen "2COOL4-U" de Haas
2COOL4-U is offline   Reply With Quote
Old 11th Nov 2001, 02:11 PM   #3
Postal
I apear to have lost my pin.
 
Postal's Avatar
 
Join Date: Nov. 14th, 1999
Posts: 1,388
cant be that, alt fire currently also reloads the guns, no prob there.

its just a ways into the game, sometime the exec reload just stops working, with out giving ut any errors.

Oh, DA looks like it will be a real fun mod, looking foward to playing it, nice models too.
__________________

Peace through superior firepower.
Postal is offline   Reply With Quote
Old 12th Nov 2001, 11:27 AM   #4
Sg_Jack
Registered User
 
Join Date: Nov. 12th, 2001
Posts: 12
I think the exec functions must be in a player class. You should make a subclass of Tournament player, and in this file put something like that :

exec function Firemodes()
{
if (weapon != None && weapon.IsA('ATFireArms'))
{
ATFireArms(weapon).SwitchFireMode();
}
}

I use this in my mod to add new functions for keys. They, you make a new keybinding class with this function. It's pretty easy.

But maybe you have already test it ?
Sg_Jack is offline   Reply With Quote
Old 12th Nov 2001, 06:25 PM   #5
Postal
I apear to have lost my pin.
 
Postal's Avatar
 
Join Date: Nov. 14th, 1999
Posts: 1,388
The very last thing I want to do is make a new playerclass, in fact I wont even do that.

Its possible to run execs in other classes too btw.

And you can always use tick, which I am about to go back to, but I would rather not. Unfortunaly sometimes in game the the exec stops working, but after switching weapons, it sometimes works again, perhaps theres some confilict with a state?
__________________

Peace through superior firepower.
Postal is offline   Reply With Quote
Old 13th Nov 2001, 06:29 AM   #6
Sg_Jack
Registered User
 
Join Date: Nov. 12th, 2001
Posts: 12
Don't understand...

Ok, i didn't knew you don't want to make a player class...

But there is somthing i don't understand : why don't you want to make binding keys ??? You could put your exec function in your weapon class, and assign it to a key.

You're not forced to make a tick function ? Why don't you test the ammo level (in a clip) before fire ? If there is no more bullets, the code goto a reload state.

I think it's better. If you use a tick function, you can (and you have ) conflicts if another function want to access a state in the same time of your tick...

What do you think ?
Sg_Jack is offline   Reply With Quote
Old 13th Nov 2001, 03:09 PM   #7
Postal
I apear to have lost my pin.
 
Postal's Avatar
 
Join Date: Nov. 14th, 1999
Posts: 1,388
ARG!

I dont want auto-reload, I spent a good bit a time a long time ago getting all of that out of there!

I have an exec in my weap class, but it doesnt always work, thats what this post is about.

Tick works fine for me ingame, but it make the logs hugh with its accessed nones, exec makes no errors, but doesnt always work, Im still wondering how to either make the tick not give accessed nones, or make the exec in gun work all the time.
__________________

Peace through superior firepower.
Postal is offline   Reply With Quote
Old 14th Nov 2001, 11:35 AM   #8
Sg_Jack
Registered User
 
Join Date: Nov. 12th, 2001
Posts: 12
Hey, i'm trying to help you. So, don't answer me like this OK ??

I don't say you to make autoreload... You can either make a new key... Making a new key doesn't mean that you'll not control your reload process...

But you don't seem to understand that maybe your code don't work... So, if you want any solution, let's stay with your bug ok ?

Cya
Sg_Jack is offline   Reply With Quote
Old 14th Nov 2001, 03:07 PM   #9
Postal
I apear to have lost my pin.
 
Postal's Avatar
 
Join Date: Nov. 14th, 1999
Posts: 1,388
Why is everyone so touchy at the moment? I am getting frustrated, for I am not getting a single answer that can help?

I did make a new key, an exec function reload, but unforuntaly its doesnt always work, does anyone have an idea of why that may be?

OR, should I go back to useing tick to check for the player hitting button bextra3

there are no conflicts with my tick code, only access nones
but my exec, while creating no errors in log, still sometimes does not work in game(will work a while, stop working, then sometimes work again)
__________________

Peace through superior firepower.
Postal is offline   Reply With Quote
Old 15th Nov 2001, 03:49 AM   #10
Sg_Jack
Registered User
 
Join Date: Nov. 12th, 2001
Posts: 12
sorry

Well, i'm not angry. I try to hlp you as best as i can, and you say me that you don't care about what i say...

You could be more friendly with something trying to help you...

About access nones, i have no idea sorry. Hope you'll find a solution
Sg_Jack is offline   Reply With Quote
Old 15th Nov 2001, 04:24 AM   #11
eXoR
Lead coder
 
eXoR's Avatar
 
Join Date: Oct. 22nd, 2001
Location: Holland
Posts: 36
Re: Reload key

Quote:
Originally posted by Postal

simulated function Tick(float DeltaTime)
{
if (Pawn(Owner) != None && Pawn(Owner).Weapon == self)
{
if (PlayerPawn(Owner).bExtra3 != 0)
{
GoToState('NewClip');
}
}
}
Hey,

I don’t know what the problem is with your exec function. I use exec functions in my mutator, in a subclass of Actor. It works great, all the time.

Now, about your Tick implentation. The Accessed None’s should be very obvious. In your if statement, you check if the weapons Owner is a valid Pawn, and then if it’s current weapon is your gun. Then, if it is a Pawn and it is your gun, you cast the Owner reference to a PlayerPawn. Thus, if any Bot is holding your weapon, the Pawn check and the weapon check will be passed. But when you try to cast that Bot to a PlayerPawn, it won’t work and there you go – accessed none. So, changing your If statement to this:

if (Playerpawn(Owner) != None && Pawn(Owner).Weapon == self)

it will not pass if the Owner is a Bot, and thus the cast won’t be made, and thus there will be no accessed none’s. Hope this helps you,

eXoR.
__________________
And he fired the harpoon.
All the anger and fury inside him exploded
If his chest had been a cannon, he would've fired his heart upon it.
eXoR is offline   Reply With Quote
Old 15th Nov 2001, 02:46 PM   #12
Postal
I apear to have lost my pin.
 
Postal's Avatar
 
Join Date: Nov. 14th, 1999
Posts: 1,388
Finally! Very gratefull.
__________________

Peace through superior firepower.
Postal is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:12 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer