Whats the mistake?

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

Whats the mistake?

Postby atrey65789 » Sun Feb 26, 12 11:18 pm

Here, I have a little somethin-somethin goin on. I'm creating a vest you can where that will put you in God mode for a little bit of time then turns off. I can't compile for some reason.


[spoiler]
//
// Invincibility Shield
// A65
//



class Invincibility extends ChargedPickup;




// ----------------------------------------------------------------------
// Turns God Mode on...
// ----------------------------------------------------------------------

function GodMode(DeusExPlayer Player)

{

PlayerPawn.ConsoleCommand( string God );


Super.GodMode(Player);

}

// ----------------------------------------------------------------------
// Turns God Mode off... frown face :(
// ----------------------------------------------------------------------

function GodModeEnd(DeusExPlayer Player)

{

PlayerPawn.ConsoleCommand( string God );


Super.GodModeEnd(Player);

}
[/spoiler]
Last edited by atrey65789 on Sun Feb 26, 12 11:19 pm, edited 1 time in total.
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm

Postby ~DJ~ » Sun Feb 26, 12 11:48 pm

Here, try this..

[spoiler]
//
// Invincibility Shield
// A65
//

class Invincibility extends ChargedPickup;

// ----------------------------------------------------------------------
// Turns God Mode on...
// ----------------------------------------------------------------------

function GodMode(DeusExPlayer Player)
{
//PlayerPawn.ConsoleCommand(string God);
//first off, there was no string specified called 'God'
//rather you can do it like this:
//PlayerPawn.ConsoleCommand("God");
//but the problem here is that the God command requires one to be an admin..
//so looking at how we 'God', on class PlayerPawn.. we get this:

PlayerPawn.ReducedDamageType = 'All';
PlayerPawn.ClientMessage("God-mode enabled"); //just to insure if it's working..

//Super.GodMode(Player);
//this command and syntax you have stated here is correct, but in this case this won't work..
//there is no function called 'GodMode()' in the parent class 'ChargedPickup'
//'Super' is called for calling previous function of the parent class, so that if you may not want to override the previous code.
//in short you don't need to call super here.

}

// ----------------------------------------------------------------------
// Turns God Mode off... frown face Sad
// ----------------------------------------------------------------------

function GodModeEnd(DeusExPlayer Player)
{
//PlayerPawn.ConsoleCommand( string God );
//Same stuff here, just getting the part of ungodding and we get this:

PlayerPawn.ReducedDamageType = 'None';
PlayerPawn.ClientMessage("God-mode disabled"); //again for insuring purposes..

//Super.GodModeEnd(Player);
//same thing here, there is no function GodModeEnd() on parent class 'ChargedPickup', this won't work.
}
[/spoiler]

Right I've fixed the code.. but still this just won't magically work... I've included in some comments so you should read those, and compare the codes..

These two functions you have stated are not being called anywhere by the way.. so.. well I'll leave you to this. Study the parent class 'ChargedPickup', and you should try calling these two functions on active and deactive states, and try doing it yourself so you learn UScript.. however if you can't seem to, just post back again and I'll try hinting something, or someone else might help you. :oops:

Good luck. :D
Last edited by ~DJ~ on Sun Feb 26, 12 11:53 pm, edited 3 times in total.
User avatar
~DJ~
Forum Super Hero
 
Posts: 3766
Joined: Tue May 22, 07 12:23 pm

Postby atrey65789 » Sun Feb 26, 12 11:56 pm

Wow... you just schooled me.... Thanks man lol I started Coding today so Yeah I got a quite amount of codes to study lol
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm

Postby Kalman11 » Mon Feb 27, 12 5:49 am

Oh, DJ, some years and u'll became Nobody :D
Kalman11
Wannabe
 
Posts: 122
Joined: Tue Aug 03, 10 2:38 pm
Location: 9th circle of hell

Postby atrey65789 » Mon Feb 27, 12 2:36 pm

I've been studying the class all throughout last night, and It still can't compile because it says Player Pawn is not a command or expression, I've been trying to think what could of caused this but I can't seem to figure it out lol maybe ONE MORE hint ... lol
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm

Postby ~DJ~ » Mon Feb 27, 12 2:55 pm

Paste your current code here please. :D
also if you can, it would be very kind of you to put it on a spoiler-box. :oops:
User avatar
~DJ~
Forum Super Hero
 
Posts: 3766
Joined: Tue May 22, 07 12:23 pm

Postby Alex » Mon Feb 27, 12 2:59 pm

You can give this a shot:
[spoiler]//=============================================================================
// Invincibility.
//=============================================================================
class Invincibility extends ChargedPickup;

// ----------------------------------------------------------------------
// Turns God Mode on...
// ----------------------------------------------------------------------
function ChargedPickupBegin(DeusExPlayer Player)
{
Player.ReducedDamageType = 'All';
Player.ClientMessage("God-mode enabled"); // just to insure if it's working..

Super.ChargedPickupBegin(Player);
}

// ----------------------------------------------------------------------
// Turns God Mode off... frown face Sad
// ----------------------------------------------------------------------
function ChargedPickupEnd(DeusExPlayer Player)
{
Player.ReducedDamageType = 'None';
Player.ClientMessage("God-mode disabled"); // again for insuring purposes..

Super.ChargedPickupEnd(Player);
}
[/spoiler]
Alex
Alpha
 
Posts: 8067
Joined: Wed Nov 12, 03 4:51 pm

Postby atrey65789 » Mon Feb 27, 12 3:08 pm

Yep that works.. Thanks!! And I will study the codes!
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm

Postby Kalman11 » Mon Feb 27, 12 3:32 pm

atrey65789 wrote:I've been studying the class all throughout last night, and It still can't compile because it says Player Pawn is not a command or expression, I've been trying to think what could of caused this but I can't seem to figure it out lol maybe ONE MORE hint ... lol

I think the problem is u used PlayerPawn instead Player (in ur function, it's Player)
Kalman11
Wannabe
 
Posts: 122
Joined: Tue Aug 03, 10 2:38 pm
Location: 9th circle of hell

Postby ~DJ~ » Mon Feb 27, 12 4:07 pm

Oh yeah, I dint notice that, sorry haha :oops:
Last edited by ~DJ~ on Mon Feb 27, 12 4:08 pm, edited 1 time in total.
User avatar
~DJ~
Forum Super Hero
 
Posts: 3766
Joined: Tue May 22, 07 12:23 pm

Postby atrey65789 » Tue Feb 28, 12 12:57 am

Lol its okay. Now I know! lol
-A
atrey65789
Regular
 
Posts: 400
Joined: Thu Dec 22, 11 3:02 pm


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 15 guests
cron