Coding problems

A refuge for those migrating from the fallen DXEditing.com and a place for general discussion relating to Deus Ex editing (coding, mapping, etc).
Post Reply
Darma
UNATCO
Posts: 151
Joined: Wed Apr 15, 2009 2:20 pm

Coding problems

Post by Darma »

Hey, I'm not really a coder but I can understand when I see some codes but when I want to make something new... I usually get some error.

Can anyone help me with this:

Code: Select all

//======================================================================
// Trigger to give a aug to the player for DXDL_Training - Darma Labs Inc. 2010 - 2012
//======================================================================
class AddAugTrigger extends Trigger;

var travel AugmentationManager AugmentationSystem;

function AddAug(class<Augmentation> WantedAug)
{
	local Augmentation anAug;

	if (AugmentationSystem != None)
	{
		anAug = AugmentationSystem.GivePlayerAugmentation(WantedAug);

		if (anAug == None)
			ClientMessage(GetItemName(String(WantedAug)) $ " is not a valid augmentation!");
	}
}

function Touch(Actor toucher)
{
AddAug(toucher,WantedAug); // I think it's this the problem
}

defaultproperties
{
}
My error is "C:\DeusEx\TrainingSystem\Classes\AddAugTrigger.uc(23) : Error, Call to 'AddAug': type mismatch in parameter 1"

But I don't think it's the only error in my file :/
EER
Illuminati
Posts: 2486
Joined: Sat Oct 22, 2005 7:52 pm
Location: NL

Re: Coding problems

Post by EER »

The function AddAug takes one argument, you pass two, which is unlikely to be correct.

The error says 'type mismatch in parameter 1', this suggests that the parameter you pass is of a different type than the one the function expects. Given that you pass an Actor as first parameter, and the function is defined to receive "class<Augmentation>" I would expect that to cause your error.
Another Visitor ... Stay a while ... Stay forever!
~DJ~
UNATCO
Posts: 277
Joined: Thu Sep 13, 2007 4:15 pm

Re: Coding problems

Post by ~DJ~ »

Well I gave him my code.. at ZxC forums. Which is working..
EER
Illuminati
Posts: 2486
Joined: Sat Oct 22, 2005 7:52 pm
Location: NL

Re: Coding problems

Post by EER »

So I guess that means the problem of the TS has been resolved? In that case: @TS: nvm for now, but please edit your post if your issue has been resolved.
Another Visitor ... Stay a while ... Stay forever!
Darma
UNATCO
Posts: 151
Joined: Wed Apr 15, 2009 2:20 pm

Re: Coding problems

Post by Darma »

Yeah, it's solved but I got disconnected theses days because my cat broked my router :/
Thanks DJ for the code :D
Post Reply